luya\base\Module::getControllerFiles PHP 메소드

getControllerFiles() 공개 메소드

Returns all controller files of this module from the getControllerPath() folder, where the key is the reusable id of this controller and value the file on the server.
부터: 1.0.0-beta5
public getControllerFiles ( ) : array
리턴 array Returns an array where the key is the controller id and value the original file.
    public function getControllerFiles()
    {
        try {
            // https://github.com/yiisoft/yii2/blob/master/framework/base/Module.php#L233
            $files = [];
            foreach (FileHelper::findFiles($this->controllerPath) as $file) {
                $value = ltrim(str_replace([$this->controllerPath, 'Controller.php'], '', $file), DIRECTORY_SEPARATOR);
                $files[Inflector::camel2id($value)] = $file;
            }
            return $files;
        } catch (InvalidParamException $e) {
            return [];
        }
    }