YII how to handle custom 404 error page along with other error pages

前端 未结 4 2221
执笔经年
执笔经年 2021-02-20 05:05

I want to display 404 error page for that i have made error404.php file in my protected/view/system folder.

By default i have Sitecontroller and it contained error acti

4条回答
  •  不要未来只要你来
    2021-02-20 05:38

    In the latest versions of the framework (I am working with 1.14) use:

    Yii::app()->errorHandler->error['code']
    

    because error is an array.

提交回复
热议问题