2011-09-28 78 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