How to get the dispatched route name in Zend framework?

前端 未结 3 896
星月不相逢
星月不相逢 2020-12-31 02:42

Current state:

  • A router is loaded from xml file
  • two route name within the router are going to the same controller and action, for example: www-languag
3条回答
  •  一整个雨季
    2020-12-31 03:24

    In my case :

    Zend_Controller_Front::getInstance()->getRouter()->getCurrentRouteName()
    

    returns Employeecontroller/:listemployee

    In Employeecontroller :

    public function listemployeeAction()
    {
        $this->getRequest()->getParam('listemployee')
    }
    

    would return either employee or trainer

提交回复
热议问题