2009-09-03 3 views
18

현재 상태 :Zend 프레임 워크에서 발송 경로 이름을 얻는 방법은 무엇입니까?

라우터는 XML 파일에서로드
  • 이 라우터에서 경로 이름은 예를 들어, 동일한 컨트롤러와 액션에가는 : www가 언어 직원 및 WWW-언어 트레이너 같은 컨트롤러와 액션에 가고있다 ->에는 EmployeeController & listemployeeAction

문제 : -/전달됩니다 요청에서 사용되는 경로 이름을 알아야합니다.

예 : 1 http://www.mycompany.com/en/trainers/ 예상 반환 값 : 내 경우 WWW-언어 트레이너

답변

8
Zend_Controller_Front::getInstance()->getRouter()->getCurrentRoute() 
41
Zend_Controller_Front::getInstance()->getRouter()->getCurrentRouteName() 
+0

. 어떤 대안? – AlfaTeK

3

:

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

반환 Employeecontroller에서 Employeecontroller/:listemployee

:

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

는 반환하거나 employee 또는 trainer 젠드 프레임 워크 1.10.6에서 작동하지 않는 것