PHP 클래스 luya\base\Module

저자: Basil Suter ([email protected])
상속: extends yii\base\Module
파일 보기 프로젝트 열기: luyadev/luya 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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//layouts. - false = looking for layout file in @module/views/layouts/. This variable is only available if your not in a context call. A context call would be if the cms renders the module.
$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

메소드 상세

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.

getLayoutPath() 공개 메소드

the *@app* namespace views will be looked up for view files
또한 보기: yii\base\Module::getLayoutPath()
public getLayoutPath ( ) : string
리턴 string

getNamespace() 공개 메소드

returns "luya\base" for example.
public getNamespace ( ) : string
리턴 string

import() 공개 메소드

Define a last of importer class with an array or run code directily with the import() method.
public import ( luya\console\interfaces\ImportControllerInterface $importer ) : boolean | array
$importer luya\console\interfaces\ImportControllerInterface The importer controller class which will be invoke to the import method.
리턴 boolean | array

init() 공개 메소드

public init ( )

registerComponents() 공개 메소드

register a component to the application. id => definition. All components will be registered during bootstrap process.
public registerComponents ( ) : array
리턴 array

resolveRoute() 공개 메소드

Extract the current module from the route and return the new resolved route.
public resolveRoute ( string $route ) : string
$route string Route to resolve, e.g. `admin/default/index`
리턴 string

프로퍼티 상세

$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' ]
public $apis

$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".
public $context

$moduleLayout 공개적으로 프로퍼티

The default name of the moduleLayout
public $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.
public $requiredComponents

$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.
public $tags

$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');
부터: 1.0.0-beta3
public $translations

$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.
public $urlRules

$useAppLayoutPath 공개적으로 프로퍼티

Defines the location of the layout file whether in the @app namespace or a module: - true = looking for layout file in @app/views//layouts. - false = looking for layout file in @module/views/layouts/. This variable is only available if your not in a context call. A context call would be if the cms renders the module.
public $useAppLayoutPath

$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
public $useAppViewPath