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'); 
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题