配置SMarty解析

在 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的符号

 

posted @ 2016-04-25 12:17  Yeah,程序猿  阅读(184)  评论(0编辑  收藏  举报