标签:
在 common/main.php中配置 View 组件
‘view‘ => [ ‘renderers‘ => [ ‘tpl‘ => [ ‘class‘ => ‘yii\smarty\ViewRenderer‘, ‘cachePath‘ => ‘@runtime/Smarty/cache‘, ‘options‘ => [ ‘left_delimiter‘ => ‘{{‘, ‘right_delimiter‘ => ‘}}‘, ] ] ]
renderers 配置需要view 文件扩展名的解析类,上图tpl结尾的文件使用 yii\smarty\viewrenderer进行解析,请注意options配置smarty的符号
标签:
原文地址:http://www.cnblogs.com/yangyuqiu/p/5430448.html