merge from master

This commit is contained in:
cuiliang
2016-06-11 20:16:28 +08:00
parent 7fd063c8a9
commit c0df003ac0
530 changed files with 5 additions and 54272 deletions

View File

@@ -363,15 +363,7 @@ class Module extends ServiceLocator
* Adds a sub-module to this module.
* @param string $id module ID
* @param Module|array|null $module the sub-module to be added to this module. This can
<<<<<<< HEAD
<<<<<<< HEAD
* be one of the followings:
=======
* be one of the following:
>>>>>>> yiichina/master
=======
* be one of the following:
>>>>>>> master
*
* - a [[Module]] object
* - a configuration array: when [[getModule()]] is called initially, the array
@@ -572,17 +564,8 @@ class Module extends ServiceLocator
}
if (is_subclass_of($className, 'yii\base\Controller')) {
<<<<<<< HEAD
<<<<<<< HEAD
return Yii::createObject($className, [$id, $this]);
=======
$controller = Yii::createObject($className, [$id, $this]);
return get_class($controller) === $className ? $controller : null;
>>>>>>> yiichina/master
=======
$controller = Yii::createObject($className, [$id, $this]);
return get_class($controller) === $className ? $controller : null;
>>>>>>> master
} elseif (YII_DEBUG) {
throw new InvalidConfigException("Controller class must extend from \\yii\\base\\Controller.");
} else {
@@ -596,48 +579,21 @@ class Module extends ServiceLocator
* The method will trigger the [[EVENT_BEFORE_ACTION]] event. The return value of the method
* will determine whether the action should continue to run.
*
<<<<<<< HEAD
<<<<<<< HEAD
=======
* In case the action should not run, the request should be handled inside of the `beforeAction` code
* by either providing the necessary output or redirecting the request. Otherwise the response will be empty.
*
>>>>>>> yiichina/master
=======
* In case the action should not run, the request should be handled inside of the `beforeAction` code
* by either providing the necessary output or redirecting the request. Otherwise the response will be empty.
*
>>>>>>> master
* If you override this method, your code should look like the following:
*
* ```php
* public function beforeAction($action)
* {
<<<<<<< HEAD
<<<<<<< HEAD
* if (parent::beforeAction($action)) {
* // your custom code here
* return true; // or false if needed
* } else {
* return false;
* }
=======
* if (!parent::beforeAction($action)) {
* return false;
* }
=======
* if (!parent::beforeAction($action)) {
* return false;
* }
>>>>>>> master
*
* // your custom code here
*
* return true; // or false to not run the action
<<<<<<< HEAD
>>>>>>> yiichina/master
=======
>>>>>>> master
* }
* ```
*