首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

yii 怎么render其他controller对应的view

2012-10-25 
yii如何render其他controller对应的view比如我现在在BlogController.php中render一个/ChatController对应

yii 如何render其他controller对应的view

比如我现在在BlogController.php中render一个/ChatController对应的view:/chat/index.view,可以这么写:

<?php $this->render('//chat/index',array('model'=>$model))?>

?

?关键就是"//"(Using single slash “/” will start the searched from the current active module’s view path instead, and falls back the search in the application’s view path.)

?

参考: http://tipstank.com/2010/07/14/how-to-renderpartial-a-file-in-another-controllers-view-folder-for-yii/

热点排行