How to get the dispatched route name in Zend framework?

前端 未结 3 897
星月不相逢
星月不相逢 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:22
    Zend_Controller_Front::getInstance()->getRouter()->getCurrentRoute()
    
    0 讨论(0)
  • 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

    0 讨论(0)
  • 2020-12-31 03:27
    Zend_Controller_Front::getInstance()->getRouter()->getCurrentRouteName()
    
    0 讨论(0)
提交回复
热议问题