프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$apis | Contains the apis for each module to provided them in the admin module. They represents the name of the api and the value represents the class. Example value: php [ 'api-admin-user' => 'admin\apis\UserController', 'api-cms-navcontainer' => 'admin\apis\NavContainerController' ] | ||
$context | if this/the module is included via another module (parent module), the parent module will write its name inside the child modules $context variable. For example the cms includes the news module, the context variable of news would have the value "cms". | ||
$moduleLayout | The default name of the moduleLayout | ||
$requiredComponents | An array containing all components which should be registered for the current module. If the component does not exists an Exception will be thrown. | ||
$tags | An array with Tag class names to inject into the tag parser on luya boot, where key is the identifier and value the create object conifg: php [ 'link' => 'luya\cms\tags\LinkTag', 'file' => ['class' => 'luya\admin\tags\FileTag'], ] As by default the yii2 configurable object you can also pass properties to your tag object in order to configure them. | ||
$translations | Add translations for your module, all translation array must have the keys "prefix", "basePath" and "fileMap" For example: php $this->translations = [ ['prefix' => 'luya*', 'basePath' => '@luya/messages', 'fileMap' => ['luya/admin' => 'admin.php']], ], To use this translation run or createa a static helper method in your module.php php Yii::t('luya/admin', 'MyVariableInAdminPhp'); | ||
$urlRules | Contains all urlRules for this module. Can't provided in key value pairing for pattern<=>route must be array containing class name or array with pattern, route informations. | ||
$useAppLayoutPath | Defines the location of the layout file whether in the @app namespace or a module:
- true = looking for layout file in @app/views/ |
||
$useAppViewPath | Define the location of the view files inside the controller actions - true = the view path of the @app/views - false = the view path of the @modulename/views |
메소드 | 설명 | |
---|---|---|
getControllerFiles ( ) : array | 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. | |
getLayoutPath ( ) : string | Override the default implementation of Yii's getLayoutPath(). If the property $useAppLayoutPath is true,. | |
getNamespace ( ) : string | returns "luya\base" for example. | |
import ( luya\console\interfaces\ImportControllerInterface $importer ) : boolean | array | Define a last of importer class with an array or run code directily with the import() method. | |
init ( ) | ||
registerComponents ( ) : array | register a component to the application. id => definition. All components will be registered during bootstrap process. | |
resolveRoute ( string $route ) : string | Extract the current module from the route and return the new resolved route. |
메소드 | 설명 | |
---|---|---|
registerTranslations ( ) | register the translation service for luya |
public getControllerFiles ( ) : array | ||
리턴 | array | Returns an array where the key is the controller id and value the original file. |
public getLayoutPath ( ) : string | ||
리턴 | string |
public registerComponents ( ) : array | ||
리턴 | array |
public resolveRoute ( string $route ) : string | ||
$route | string | Route to resolve, e.g. `admin/default/index` |
리턴 | string |
public $apis |
public $context |
public $requiredComponents |
public $tags |
public $translations |
public $urlRules |
public $useAppLayoutPath |