base\Module setVersion()

setVersion() public method (available since version 2.0.11) Sets current module version. public void setVersion ( $version )$version string|callable The version of this module. Version can be specified as a PHP callback, which can accept module instance as an argument and should return the actual version. For example: function (Module $module) { //return string }

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 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 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 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 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 init()

init() public method Initializes the module. This method is called after the module is created and initialized with property values given in configuration. The default implementation will initialize $controllerNamespace if it is not set. If you override this method, please make sure you call the parent implementation. public void init ( )

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.