https://github.com/yiisoft/yii2-smarty
php composer.phar require –prefer-dist yiisoft/yii2-smarty
return [
//....
'components' => [
'view' => [
'renderers' => [
'tpl' => [
'class' => 'yii\smarty\ViewRenderer',
//'cachePath' => '@runtime/Smarty/cache',
],
],
],
],
];
public function actionTest() {
return $this->render('test.tpl',['test'=>'smarty']);
}
<div>123456{$test}</div>
‘urlManager’ => [
‘enablePrettyUrl’ => true,
‘showScriptName’ => false,
‘rules’ => [
],
],