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:
@ -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