Zend_Navigation 用数组覆盖?
我目前通过 XML 文件使用 zend_navigation。
但是,我需要在控制器中覆盖以前的面包屑,使其成为其动态父级。
这可能吗?在我看来,zend_navigation 是相当静态的,并且 zend 文档不断超时。
谢谢,
我已经将:
public function addAction() {
$this->view->navigation()->addPage(array(
'type' => 'uri',
'label' => 'New page')
);
放在我的控制器中,但该页面没有显示面包屑栏。
有什么想法吗? $this->navigation() 抛出了一个
Method "navigation" does not exist and was not trapped in __call()
另外值得注意的是,我的 crumbBar 位于我的布局中,而不是单独的视图中。
I currently use zend_navigation via an XML file.
However I need to overwrite the previous breadcrumb to be its dynamic parent, in the controller.
Is this possible? It seems to me that zend_navigation is fairly static and the zend documentation keeps timing out.
Thanks
I have put:
public function addAction() {
$this->view->navigation()->addPage(array(
'type' => 'uri',
'label' => 'New page')
);
in my controller but no crumbbar shows up for that page.
Any ideas? $this->navigation() threw a
Method "navigation" does not exist and was not trapped in __call()
Also of note that my crumbBar is in my layout and not individual views.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您可以使用数组。
您真正应该做的是创建数组,然后将其输入到 Zend_Navigation 的工厂中来为您创建页面。
不幸的是,我的代码太复杂,无法展示我如何使用它的示例。但我将提供一个简单的示例...
创建导航容器后,您可以向其中添加新页面。
喜欢
但你也可以使用 addPages()。这就是我所做的。
我认为您应该等待文档加载回来,然后查看它。事实上这真的很容易。
当你有更具体的问题时,尽管问,然后戳我一下。我经常使用导航,所以对它非常了解。
此外,请查看 freenode 上的#zftalk。那里有很多帮助。
Yes you can use an array.
What you should do really is create your array and then input it into the factory of the Zend_Navigation to create your pages for you.
Unfortunately my code is too complicated to show an example of how I used it. But I'll provide a simple example...
Once you create your navigation container, you can just add new pages to it.
Like
But you can also use addPages(). This is what I do.
I think you should just wait for the documentation to load back up for you and then look at that. Its really easy in fact.
When you have a more specific question, just ask that and give me a poke. I've had to use Navigation quite a lot so know it quite well.
Additionally, check out #zftalk on freenode. Theres lots of help on there.
另外,使用 Zend Router 将 site.com/sitemap.xml 重定向到此控制器/功能。
感谢许多帮助我到达这里的开发人员。
Additionally uses Zend Router for redirecting site.com/sitemap.xml to this controller/function.
Thank you for many developers who help me to reach here.