
1、首先进到yii框架的frontendconfig文件夹下,里面有一个main.php文件,打开编辑,修改其中的控制器名和方法名:

2、然后进到controllers控制器中,在控制器code里面添加error方法。

返回顶部插件jquery.gototop
返回顶部插件jquery.gototop是一款当在用户向下滚动页面一段距离之后,会以CSS3动画方式出现返回顶部按钮。点击返回顶部按钮之后,页面以平滑的方式滚动回顶部。
20 查看详情
3、最后在V层创建你的视图(这里是error.php):
title = $name;$this->context->layout = false; //不使用布局,或者改为自己所需要使用的布局?>这个.. 页面没有找到!!!_SJ5D.COM body{ margin:0; padding:0; background:#efefef; font-family:Georgia, Times, Verdana, Geneva, Arial, Helvetica, sans-serif; } div#mother{ margin:0 auto; width:943px; height:572px; position:relative; } div#errorBox{ background: url(/404_bg.png) no-repeat top left;width:943px; height:572px;margin:auto;} div#errorText{ color:#39351e; padding:146px 0 0 446px } div#errorText p{ width:303px; font-size:14px; line-height:26px; } div.link{ /*background:#f90;*/ height:50px; width:145px; float:left; } div#home{ margin:20px 0 0 444px;} div#contact{ margin:20px 0 0 25px;} h1{ font-size:40px; margin-bottom:35px; }
创想鸟,大量的免费yii入门教程,欢迎在线学习!
以上就是yii怎么返回404的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/364600.html
微信扫一扫
支付宝扫一扫