mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-10 23:50:38 +08:00
Cosmetic changes
This commit is contained in:
@@ -39,7 +39,7 @@ class Module extends ServiceLocator
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @event ActionEvent an event raised before executing a controller action.
|
* @event ActionEvent an event raised before executing a controller action.
|
||||||
* You may set [[ActionEvent::isValid]] to be false to cancel the action execution.
|
* You may set [[ActionEvent::isValid]] to be `false` to cancel the action execution.
|
||||||
*/
|
*/
|
||||||
const EVENT_BEFORE_ACTION = 'beforeAction';
|
const EVENT_BEFORE_ACTION = 'beforeAction';
|
||||||
/**
|
/**
|
||||||
@@ -62,7 +62,7 @@ class Module extends ServiceLocator
|
|||||||
/**
|
/**
|
||||||
* @var string|boolean the layout that should be applied for views within this module. This refers to a view name
|
* @var string|boolean the layout that should be applied for views within this module. This refers to a view name
|
||||||
* relative to [[layoutPath]]. If this is not set, it means the layout value of the [[module|parent module]]
|
* relative to [[layoutPath]]. If this is not set, it means the layout value of the [[module|parent module]]
|
||||||
* will be taken. If this is false, layout will be disabled within this module.
|
* will be taken. If this is `false`, layout will be disabled within this module.
|
||||||
*/
|
*/
|
||||||
public $layout;
|
public $layout;
|
||||||
/**
|
/**
|
||||||
@@ -140,7 +140,7 @@ class Module extends ServiceLocator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the currently requested instance of this module class.
|
* Returns the currently requested instance of this module class.
|
||||||
* If the module class is not currently requested, null will be returned.
|
* If the module class is not currently requested, `null` will be returned.
|
||||||
* This method is provided so that you access the module instance from anywhere within the module.
|
* This method is provided so that you access the module instance from anywhere within the module.
|
||||||
* @return static|null the currently requested instance of this module class, or null if the module class is not requested.
|
* @return static|null the currently requested instance of this module class, or null if the module class is not requested.
|
||||||
*/
|
*/
|
||||||
@@ -153,7 +153,7 @@ class Module extends ServiceLocator
|
|||||||
/**
|
/**
|
||||||
* Sets the currently requested instance of this module class.
|
* Sets the currently requested instance of this module class.
|
||||||
* @param Module|null $instance the currently requested instance of this module class.
|
* @param Module|null $instance the currently requested instance of this module class.
|
||||||
* If it is null, the instance of the calling class will be removed, if any.
|
* If it is `null`, the instance of the calling class will be removed, if any.
|
||||||
*/
|
*/
|
||||||
public static function setInstance($instance)
|
public static function setInstance($instance)
|
||||||
{
|
{
|
||||||
@@ -332,7 +332,7 @@ class Module extends ServiceLocator
|
|||||||
* @param string $id module ID (case-sensitive). To retrieve grand child modules,
|
* @param string $id module ID (case-sensitive). To retrieve grand child modules,
|
||||||
* use ID path relative to this module (e.g. `admin/content`).
|
* use ID path relative to this module (e.g. `admin/content`).
|
||||||
* @param boolean $load whether to load the module if it is not yet loaded.
|
* @param boolean $load whether to load the module if it is not yet loaded.
|
||||||
* @return Module|null the module instance, null if the module does not exist.
|
* @return Module|null the module instance, `null` if the module does not exist.
|
||||||
* @see hasModule()
|
* @see hasModule()
|
||||||
*/
|
*/
|
||||||
public function getModule($id, $load = true)
|
public function getModule($id, $load = true)
|
||||||
@@ -368,7 +368,7 @@ class Module extends ServiceLocator
|
|||||||
* - a [[Module]] object
|
* - a [[Module]] object
|
||||||
* - a configuration array: when [[getModule()]] is called initially, the array
|
* - a configuration array: when [[getModule()]] is called initially, the array
|
||||||
* will be used to instantiate the sub-module
|
* will be used to instantiate the sub-module
|
||||||
* - null: the named sub-module will be removed from this module
|
* - `null`: the named sub-module will be removed from this module
|
||||||
*/
|
*/
|
||||||
public function setModule($id, $module)
|
public function setModule($id, $module)
|
||||||
{
|
{
|
||||||
@@ -381,7 +381,7 @@ class Module extends ServiceLocator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the sub-modules in this module.
|
* Returns the sub-modules in this module.
|
||||||
* @param boolean $loadedOnly whether to return the loaded sub-modules only. If this is set false,
|
* @param boolean $loadedOnly whether to return the loaded sub-modules only. If this is set `false`,
|
||||||
* then all sub-modules registered in this module will be returned, whether they are loaded or not.
|
* then all sub-modules registered in this module will be returned, whether they are loaded or not.
|
||||||
* Loaded modules will be returned as objects, while unloaded modules as configuration arrays.
|
* Loaded modules will be returned as objects, while unloaded modules as configuration arrays.
|
||||||
* @return array the modules (indexed by their IDs)
|
* @return array the modules (indexed by their IDs)
|
||||||
@@ -476,11 +476,11 @@ class Module extends ServiceLocator
|
|||||||
* or `abc\def\XyzController` class within the [[controllerNamespace|controller namespace]].
|
* or `abc\def\XyzController` class within the [[controllerNamespace|controller namespace]].
|
||||||
*
|
*
|
||||||
* If any of the above steps resolves into a controller, it is returned together with the rest
|
* If any of the above steps resolves into a controller, it is returned together with the rest
|
||||||
* part of the route which will be treated as the action ID. Otherwise, false will be returned.
|
* part of the route which will be treated as the action ID. Otherwise, `false` will be returned.
|
||||||
*
|
*
|
||||||
* @param string $route the route consisting of module, controller and action IDs.
|
* @param string $route the route consisting of module, controller and action IDs.
|
||||||
* @return array|boolean If the controller is created successfully, it will be returned together
|
* @return array|boolean If the controller is created successfully, it will be returned together
|
||||||
* with the requested action ID. Otherwise false will be returned.
|
* with the requested action ID. Otherwise `false` will be returned.
|
||||||
* @throws InvalidConfigException if the controller class and its file do not match.
|
* @throws InvalidConfigException if the controller class and its file do not match.
|
||||||
*/
|
*/
|
||||||
public function createController($route)
|
public function createController($route)
|
||||||
@@ -535,7 +535,7 @@ class Module extends ServiceLocator
|
|||||||
* Note that this method does not check [[modules]] or [[controllerMap]].
|
* Note that this method does not check [[modules]] or [[controllerMap]].
|
||||||
*
|
*
|
||||||
* @param string $id the controller ID
|
* @param string $id the controller ID
|
||||||
* @return Controller the newly created controller instance, or null if the controller ID is invalid.
|
* @return Controller the newly created controller instance, or `null` if the controller ID is invalid.
|
||||||
* @throws InvalidConfigException if the controller class and its file name do not match.
|
* @throws InvalidConfigException if the controller class and its file name do not match.
|
||||||
* This exception is only thrown when in debug mode.
|
* This exception is only thrown when in debug mode.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user