在Yii2版本的advanced高级模板环境中:设置404自定义页面的方法
1.config/main.php文件
'errorHandler' => [ 'errorAction' => 'site/error', ],
2.views/site/error.php
<?php $this->context->layout = false; //不使用布局,或者改为自己所需要使用的布局 ?> <div class="site-error"> <h1>404</h1> </div>
在Yii2版本的advanced高级模板环境中:设置404自定义页面的方法
1.config/main.php文件
'errorHandler' => [ 'errorAction' => 'site/error', ],
2.views/site/error.php
<?php $this->context->layout = false; //不使用布局,或者改为自己所需要使用的布局 ?> <div class="site-error"> <h1>404</h1> </div>
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。