Richard Knop
Richard Knop

Reputation: 83755

How to get controller and action name in ErrorController

How can I get a controller and an action name in the ErrorController? I mean the controller and action where an exception occurred. For example, if I go to:

/bogusController/bogusAction

I would like to get "bogusController" and "bogusAction". Calling:

$this->_request->getControllerName();
$this->_request->getActionName();

Returns "error" and "error".

Upvotes: 0

Views: 412

Answers (1)

Distdev
Distdev

Reputation: 2312

Original request is stored in error_handler param: $this->_getParam('error_handler')->request->getControllerName();

Some docs: http://framework.zend.com/manual/en/zend.controller.plugins.html#zend.controller.plugins.standard.errorhandler

Upvotes: 6

Related Questions