我在protected / views / directory_controller_name下有一个PHP文件,格式就是这样
<p> <?PHP echo $model->title;?> </p> ...
$this->render('filename',array('model'=>$model));
但是知道,我需要发送一个具有相同模板/布局的电子邮件,所以我想将文件的渲染存储在一个变量中
$msgHTML = $this-> renderInternal(‘_ items’,array(‘model’=> $model));
But it doesn't work!
我不想用:
$msgHTML = '<p>'.$model->title.'</p>' ...
$msgHTML = $this->renderInternal('_items',array('model'=>$model),true);
http://www.yiiframework.com/doc/api/1.1/CBaseController#renderInternal-detail