When an ID is found to be in both Application::controllerMap and Application::modules, the former will take precedence

This commit is contained in:
Qiang Xue
2014-09-04 23:34:11 -04:00
parent aeb8dd560a
commit ef1a6d20d1
2 changed files with 5 additions and 5 deletions

View File

@ -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);