2009-12-17 1 views
0

Zend_Config_Xml의 인스턴스에서 Zend_Navigation이 호출 될 때 예외가 발생합니다. XML 파일을 구문 분석Zend : Zend_Config_Xml 및 Zend_Navigation을 사용하여 탐색 경로 탐색

protected function _initNavigation() { 
$this->bootstrap('layout'); 
$layout = $this->getResource('layout'); 
$view = $layout->getView(); 
$config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml'); 
$navigation = new Zend_Navigation($config); // exception is thrown here 
$view->navigation($navigation); 
} 

정확히 오류가 발생되는 http://framework.zend.com/manual/en/zend.navigation.containers.html

@ 예 37.11의 복사본입니다 :

여기

은 (Bootstrap.php)에 실패하는 방법이다
  • 치명적 오류 : '잘못된 인수 : 인스턴스화 할 클래스를 결정할 수 없습니다'라는 캐치 예외 'Zend_Navigation_Exception'이 /usr/share/php/Zend/Navigation/Page.php:223 St에 있습니다. ack 추적 : # 0 /usr/share/php/Zend/Navigation/Container.php(117) : Zend_Navigation_Page :: factory (Array) # 1 /usr/share/php/Zend/Navigation/Container.php(164) : Zend_Navigation_Container->의 addPage (배열) # 2 /usr/share/php/Zend/Navigation.php(46) : Zend_Navigation_Container-> addPages (오브젝트 (Zend_Config_Xml)) # 3 /www/padilla/application/Bootstrap.php(50) : Zend_Navigation -> __ 구조 (객체 (Zend_Config_Xml)) # 4 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php(662) : 부트 스트랩 -> _ initNavigation() # 5는/usr/share/PHP/젠드/응용 프로그램/부트 스트랩/BootstrapAbstract.php (615) : Zend_Application_Bootstrap_BootstrapAbstract -> _ executeResource ('navigation') # 6 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php(579) : Zend_Application_Bootstrap_BootstrapAbstract -> _ bootstrap (NULL) # /usr/share/php/Zend/Application.php(347 7) 라인에 /usr/share/php/Zend/Navigation/Page.php Zend_Application_B 223
012,

아마도 내가 누락되었거나 xml 구조를 변경/사용자 정의해야합니다.

+0

navigation.xml을 붙여 넣을 수 있습니까? –

답변

4

인스 턴싱 Zend_Config_Xml이 예제와 다르게 나타납니다. 섹션을 두 번째 매개 변수로 지정하는 것을 잊었습니다. 당신이 거기 , 'nav' 비트를 추가하는 경우

$config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav'); 

, 당신의 XML을 assumming 정확히 링크에서처럼, 그것은 작동해야합니다.

+0

어리석은 나를 ........ –