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

前端之家收集整理的这篇文章主要介绍了zend-framework – 如何使用Zend中不同模块的部分视图?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试从另一个模块栏访问foo中的部分视图.简化文件结构:
  1. application/
  2. modules/
  3. foo/
  4. index.phtml
  5. bar/
  6. partial.phtml

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

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

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

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

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

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

猜你在找的PHP相关文章