Wednesday, November 11, 2009

get name of module, controller and method/action in Zend Framework

// How to get name of module, controller and method/action in Zend Framework.


<?php
    // How to get name of module, controller and method/action in Zend Framework.
    $front1 = Zend_Controller_Front::
getInstance();
    $module1 = $front1->getRequest()->getModuleName();
    $controller1 = $front1->getRequest()->getControllerName();
    $action1 = $front1->getRequest()->getActionName();
    echo "<br/><br/>".$module1;
    echo "<br/><br/>".$controller1;
    echo "<br/><br/>".$action1;
?>

No comments:

Post a Comment