mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 06:11:35 +08:00
When an ID is found to be in both Application::controllerMap
and Application::modules
, the former will take precedence
This commit is contained in:
@ -262,6 +262,7 @@ Yii Framework 2 Change Log
|
||||
- Chg: Use `limit(null)` instead of `limit(-1)` in migration controller to be compatible to more backends (cebe)
|
||||
- Chg: `yii\web\Request::cookieValidationKey` must be explicitly specified for each application that wants to use cookie validation (qiangxue)
|
||||
- Chg: Added `yii\composer\Installer::postCreateProject()` and modified the syntax of calling installer methods in composer.json (qiangxue)
|
||||
- Chg: When an ID is found to be in both `Application::controllerMap` and `Application::modules`, the former will take precedence (qiangxue)
|
||||
- New #3911: Added `yii\behaviors\SluggableBehavior` that fills the specified model attribute with the transliterated and adjusted version to use in URLs (creocoder)
|
||||
- New #4193: Added `yii\filters\Cors` CORS filter to allow Cross Origin Resource Sharing (pgaultier)
|
||||
- New: Added `yii\base\InvalidValueException` (qiangxue)
|
||||
|
@ -511,15 +511,14 @@ class Module extends ServiceLocator
|
||||
}
|
||||
|
||||
// module and controller map take precedence
|
||||
if (isset($this->controllerMap[$id])) {
|
||||
$controller = Yii::createObject($this->controllerMap[$id], [$id, $this]);
|
||||
return [$controller, $route];
|
||||
}
|
||||
$module = $this->getModule($id);
|
||||
if ($module !== null) {
|
||||
return $module->createController($route);
|
||||
}
|
||||
if (isset($this->controllerMap[$id])) {
|
||||
$controller = Yii::createObject($this->controllerMap[$id], [$id, $this]);
|
||||
|
||||
return [$controller, $route];
|
||||
}
|
||||
|
||||
if (($pos = strrpos($route, '/')) !== false) {
|
||||
$id .= '/' . substr($route, 0, $pos);
|
||||
|
Reference in New Issue
Block a user