luya\base\Module::getControllerFiles PHP Method

getControllerFiles() public method

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.
Since: 1.0.0-beta5
public getControllerFiles ( ) : array
return 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 [];
        }
    }