doue9730 2014-07-14 08:33 采纳率: 100%
浏览 38
已采纳

ZF2:如何从其他模块渲染视图

I have a problem with rendering view from other module.

For example: I'm on page news.phtml and I need to add 'Add comment' page. The view of adding comments is in other module 'Comments' in file add.phtml.

I have no idea how to include this file on news page. I've tried something like this:

echo $this->render('module/Comments/view/comments/index/add.phtml'); 
echo $this->render('../../Comments/view/comments/index/add.phtml');

but nothing works. How could I do that?

  • 写回答

1条回答 默认 最新

  • dongnong3019 2014-07-14 09:12
    关注

    you need to use partial view helper

    echo $this->partial('comments/index/add'); 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效