Categories
Zend Framework 1.12

Get the Current Action, Controller or Module with Zend Framework?

From within a controller:


$controller = $this->getRequest()->getControllerName();
$action = $this->getRequest()->getActionName();

From within a view:


Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
Zend_Controller_Front::getInstance()->getRequest()->getActionName();