mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
Default to Zend's dispatcher if the controller name is empty
refs #5786
This commit is contained in:
parent
d4de7c0519
commit
8b32edd6e9
@ -11,18 +11,23 @@ use Zend_Controller_Response_Abstract;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispatcher supporting Zend-style and namespaced controllers
|
* Dispatcher supporting Zend-style and namespaced controllers
|
||||||
|
*
|
||||||
|
* Does not support a namespaced default controller in combination w/ the Zend parameter useDefaultControllerAlways.
|
||||||
*/
|
*/
|
||||||
class Dispatcher extends Zend_Controller_Dispatcher_Standard
|
class Dispatcher extends Zend_Controller_Dispatcher_Standard
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* Dispatch request to a controller and action
|
||||||
|
*
|
||||||
|
* @param Zend_Controller_Request_Abstract $request
|
||||||
|
* @param Zend_Controller_Response_Abstract $resposne
|
||||||
*/
|
*/
|
||||||
public function dispatch(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response)
|
public function dispatch(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response)
|
||||||
{
|
{
|
||||||
$this->setResponse($response);
|
$this->setResponse($response);
|
||||||
$controllerName = $request->getControllerName();
|
$controllerName = $request->getControllerName();
|
||||||
if (! $controllerName) {
|
if (! $controllerName) {
|
||||||
throw new LogicException('Controller name not found');
|
return parent::dispatch($request, $response);
|
||||||
}
|
}
|
||||||
$controllerName = ucfirst($controllerName) . 'Controller';
|
$controllerName = ucfirst($controllerName) . 'Controller';
|
||||||
if ($this->_defaultModule === $this->_curModule) {
|
if ($this->_defaultModule === $this->_curModule) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user