diff --git a/cake/basics.php b/cake/basics.php index dbc1c4ba8..d0b3d6ced 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -279,6 +279,8 @@ } if(strpos($name, '.') !== false){ list($plugin, $name) = explode('.', $name); + loadPluginController($plugin, $name); + return; } $className = $name . 'Controller'; @@ -326,6 +328,7 @@ */ function loadPluginController($plugin, $controller) { $pluginAppController = Inflector::camelize($plugin . '_app_controller'); + $plugin = Inflector::underscore($plugin); $pluginAppControllerFile = APP . 'plugins' . DS . $plugin . DS . $plugin . '_app_controller.php'; if (!class_exists($pluginAppController)) { if (file_exists($pluginAppControllerFile)) { @@ -336,7 +339,7 @@ } if (empty($controller)) { - if (!class_exists($plugin . 'Controller')) { + if (!class_exists(Inflector::camelize($plugin . 'controller'))) { if (file_exists(APP . 'plugins' . DS . $plugin . DS . 'controllers' . DS . $plugin . '_controller.php')) { require(APP . 'plugins' . DS . $plugin . DS . 'controllers' . DS . $plugin . '_controller.php'); return true; diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 40c2e4dba..259890d72 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -96,7 +96,7 @@ class Dispatcher extends Object { if (!loadController($ctrlName)) { $pluginName = Inflector::camelize($params['action']); - if (!loadPluginController(Inflector::underscore($ctrlName), $pluginName)) { + if (!loadController($ctrlName . '.' . $pluginName)) { if(preg_match('/([\\.]+)/', $ctrlName)) { Router::setRequestInfo(array($params, array('base' => $this->base, 'webroot' => $this->webroot)));