$config['components'][ 'view'][ 'theme']=[
// 'basePath' => '@app/themes/spring',
// 'baseUrl' => '@web/themes/spring',
'pathMap' => [
'@app/views' => [
'@app/views/pc',
'@app/views/mobile',
]
],
];
我这样设置以后
然后再控制器里修改 布局文件夹
public $layout = 'return';
然后在views/pc/layouts/return.php文件里引入main.php
<?php use yii\helpers\Html;
$this->beginContent('main'); ?>
<center>
<?=$content; ?>
</center>
<p/>
<center>
<?=Html::button('返回',['onclick'=>'javacript:history.go(-1)','class'=>'btn btn-success btn-block'])?>
</center>
<?php $this->endContent(); ?>
报错提示视图文件不存在 The view file does not exist: main 请问怎么解决