读书人

yii 怎么render其他controller对应的

发布时间: 2012-10-25 10:58:57 作者: rapoo

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/

读书人网 >编程

热点推荐