2011-09-28 81 views
0

我正在開發一個使用Zend Framework的網站。 我在使用本網站以獲得導航工作:http://www.rvdavid.net/zend_navigation-makes-writing-navigation-for-zf-sites-very-easy/Zend_Navigation和模塊特定的佈局

但是,$ this-> layout() - >菜單返回NULL。 我有一個模塊化結構,具有一個插件,需要照顧模塊具體佈局:

<?php 
class Custom_Controller_Plugin_ModuleBasedLayout 
    extends Zend_Layout_Controller_Plugin_Layout 
{ 
public function preDispatch(Zend_Controller_Request_Abstract $request) 
{ 
     $this->getLayout()->setLayoutPath(Zend_Registry::get('config')->resources->frontController->moduleDirectory 
     . DS . $request->getModuleName() . DS . 'layouts'); 
} 
} 

沒有任何人有一個線索,爲什麼我的導航不工作?

+0

使用導航視圖助手做了它應該是$這個 - >佈局() - >菜單( )。菜單是一種方法,而不是屬性。 – markus

回答

0

$this->navigation()->menu();

$this->layout()->menu

Zend_Navigation的所有渲染的東西是你在*.phtml files

+0

好吧,我現在感覺很愚蠢。 ;) – rbnvrw