parent
06e879f078
commit
7252f3237a
|
@ -307,7 +307,7 @@ class Web extends EmbeddedWeb
|
|||
$this
|
||||
->getLoader()
|
||||
->registerNamespace(
|
||||
'Icinga\\Controllers',
|
||||
'Icinga\\' . Dispatcher::CONTROLLER_NAMESPACE,
|
||||
$this->getApplicationDir('controllers')
|
||||
)
|
||||
->registerNamespace(
|
||||
|
|
|
@ -18,6 +18,13 @@ use Zend_Controller_Response_Abstract;
|
|||
*/
|
||||
class Dispatcher extends Zend_Controller_Dispatcher_Standard
|
||||
{
|
||||
/**
|
||||
* Controller namespace
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const CONTROLLER_NAMESPACE = 'Controller';
|
||||
|
||||
/**
|
||||
* Dispatch request to a controller and action
|
||||
*
|
||||
|
@ -38,9 +45,10 @@ class Dispatcher extends Zend_Controller_Dispatcher_Standard
|
|||
}
|
||||
$controllerName = ucfirst($controllerName) . 'Controller';
|
||||
if ($this->_defaultModule === $this->_curModule) {
|
||||
$controllerClass = 'Icinga\\Controllers\\' . $controllerName;
|
||||
$controllerClass = 'Icinga\\' . self::CONTROLLER_NAMESPACE . '\\' . $controllerName;
|
||||
} else {
|
||||
$controllerClass = 'Icinga\\Module\\' . $this->_curModule . '\\Controllers\\' . $controllerName;
|
||||
$controllerClass = 'Icinga\\Module\\' . $this->_curModule . '\\' . self::CONTROLLER_NAMESPACE . '\\'
|
||||
. $controllerName;
|
||||
}
|
||||
if (! class_exists($controllerClass)) {
|
||||
parent::dispatch($request, $response);
|
||||
|
|
Loading…
Reference in New Issue