微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

zend-framework – 如何使用Zend中不同模块的部分视图?

我正在尝试从另一个模块栏访问foo中的部分视图.简化文件结构:
application/
    modules/
        foo/
            index.phtml
        bar/
            partial.phtml

在index.html中,您将具有以下代码

<?PHP echo $this->partialLoop('../bar/partial.phtml',$this->paginator);
echo $this->paginator; ?>

问题是你实际上不能使用父遍历,因为我得到这个错误

Requested scripts may not include parent directory traversal ("../","..\" notation)

是否有任何方法仍然将部分视图包含在我的内容页面中? (或者我做错了吗?)提前感谢.

你需要传递模块参数:
<?PHP echo $this->partialLoop('partial.phtml','bar',$this->paginator); ?>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐