具有部分基础的模块化 Zend 框架
目前我发现我必须不断复制不同模块的部分内容。
我想要一个可供访问所有部分的案例目录。
有人有这样做的好方法吗?
谢谢
Currently I'm finding I have to keep duplicating partials for different modules.
I would like to have a case directory for all partials to be accessed.
Does anyone have a good way of doing this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您也可以将 $this->partial 与三个参数一起使用。第二个参数是模块名称,第三个参数成为模型。
摘自:
http://framework.zend.com/manual/en/zend.view .helpers.html
编辑 - 从控制器的操作范围内访问视图部分
I think you can also use $this->partial with three arguments. The second argument is a module name and the third argument becomes the model.
Taken From:
http://framework.zend.com/manual/en/zend.view.helpers.html
EDIT - Accessing view partials from within a Controller's Action scope
非常感谢:)
但是,我如何通过控制器执行此操作?我有 fancybox 并设置了 ajax 布局:
根据需要弹出窗口,但出现以下错误:
我有点假设 $this->view->partial 与使用 $this->partial 相同在视图模板内,但我想不是。有想法吗?
已解决:
Bootstrap initView,添加:
将我的部分内容移至该目录。然后在我的控制器中我这样做:
感谢 #zftalks SmartSsa
Excellent thanks :)
However, how do I do this via the controller? I have fancybox and have set up the ajax layout:
The pop up window as required but with the following error:
I kinda of assumed the $this->view->partial would be the same as using $this->partial inside the view template, but I guess not. Ideas?
SOLVED VIA:
Bootstrap initView, added:
Moved my partials to that directory. Then in my controller I do:
Thanks goes out to #zftalks SmartSsa