base\Module setViewPath()

setViewPath() public method Sets the directory that contains the view files. public void setViewPath ( $path )$path string The root directory of view files. throws yii\base\InvalidParamException if the directory is invalid.

base\Module setModules()

setModules() public method Registers sub-modules in the current module. Each sub-module should be specified as a name-value pair, where name refers to the ID of the module and value the module or a configuration array that can be used to create the module. In the latter case, Yii::createObject() will be used to create the module. If a new sub-module has the same ID as an existing one, the existing one will be overwritten silently. The following is an example for registering two sub-modules:

base\Module setLayoutPath()

setLayoutPath() public method Sets the directory that contains the layout files. public void setLayoutPath ( $path )$path string The root directory or path alias of layout files. throws yii\base\InvalidParamException if the directory is invalid

base\Module setInstance()

setInstance() public static method Sets the currently requested instance of this module class. public static void setInstance ( $instance )$instance yii\base\Module|null The currently requested instance of this module class. If it is null, the instance of the calling class will be removed, if any.

base\Module setModule()

setModule() public method Adds a sub-module to this module. public void setModule ( $id, $module )$id string Module ID. $module yii\base\Module|array|null The sub-module to be added to this module. This can be one of the following: a yii\base\Module object a configuration array: when getModule() is called initially, the array will be used to instantiate the sub-module null: the named sub-module will be removed from this module

base\Module runAction()

runAction() public method Runs a controller action specified by a route. This method parses the specified route and creates the corresponding child module(s), controller and action instances. It then calls yii\base\Controller::runAction() to run the action with the given parameters. If the route is empty, the method will use $defaultRoute. public mixed runAction ( $route, $params = [] )$route string The route that specifies the action. $params array The parameters to be passed to the a

base\Module setBasePath()

setBasePath() public method Sets the root directory of the module. This method can only be invoked at the beginning of the constructor. public void setBasePath ( $path )$path string The root directory of the module. This can be either a directory name or a path alias. throws yii\base\InvalidParamException if the directory does not exist.

base\Module setAliases()

setAliases() public method Defines path aliases. This method calls Yii::setAlias() to register the path aliases. This method is provided so that you can define path aliases when configuring a module. public void setAliases ( $aliases )$aliases array List of path aliases to be defined. The array keys are alias names (must start with @) and the array values are the corresponding paths or aliases. For example, [ '@models' => '@app/models', // an existing alias '@backend' => __

base\Module hasModule()

hasModule() public method Checks whether the child module of the specified ID exists. This method supports checking the existence of both child and grand child modules. public boolean hasModule ( $id )$id string Module ID. For grand child modules, use ID path relative to this module (e.g. admin/content). return boolean Whether the named module exists. Both loaded and unloaded modules are considered.

base\Module getVersion()

getVersion() public method (available since version 2.0.11) Returns current module version. If version is not explicitly set, defaultVersion() method will be used to determine its value. public string getVersion ( )return string The version of this module.