【问题标题】:Zend_Navigation and module specific layoutZend_Navigation 和模块特定布局
【发布时间】:2011-09-28 18:00:36
【问题描述】:

我正在使用 Zend 框架开发一个网站。 我正在使用这个网站来让我的导航正常工作:http://www.rvdavid.net/zend_navigation-makes-writing-navigation-for-zf-sites-very-easy/

但是,$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' );
}
} 

有人知道为什么我的导航不起作用吗?

【问题讨论】:

  • 应该是$this->layout()->menu()。 Menu 是一种方法,而不是属性。

标签: zend-framework module bootstrapping zend-navigation


【解决方案1】:

它的$this-&gt;navigation()-&gt;menu();

不是$this-&gt;layout()-&gt;menu

Zend_Navigation 的所有渲染工作都是由您在*.phtml files 中使用的导航视图助手完成的

【讨论】:

    猜你喜欢
    • 2014-04-27
    • 1970-01-01
    • 2013-10-25
    • 2011-03-30
    • 1970-01-01
    • 2013-07-26
    • 2011-05-06
    • 2016-10-12
    • 1970-01-01
    相关资源
    最近更新 更多