0
問題是:Does Yii have any method(s) to render variable with code in it?
默認:
$this->render('site/index');
其中site/index
是路徑,以查看文件。
我需要做的是:
$content = '<div><?php echo "do something here"; ?></div>';
$this->render($content);
輸出應該是佈局+解析的內容Yii的渲染變量不能查看文件
我試圖用$this->renderText($content);
但這種方法會返回空字符串。
我使用Smarty的擴展渲染視圖文件,然後$this->renderText($content);
回報不會被解析字符串:{assign ..}
任何幫助,將不勝感激。
是啊..但我需要準確變量而不是文件 – 2015-02-09 10:50:35