Xml – How to get the dispatched route name in Zend framework

routesxmlzend-frameworkzend-router

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-language-employee and www-language-trainer are going to the same controller and action –> EmployeeController & listemployeeAction

Problem:
– Need to know which route name is dispatched/being used from a request.

Example:
1. http://www.mycompany.com/en/trainers/
Expected return value: www-language-trainer

Best Answer

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