使用fastadmin的页面异常模板
1、效果图
2、修改tp异常页面的模板文件( /thinkphp/tpl/think_exception.tpl ),将文件中的内容全部替换成下面的内容然后保存即可(若发生报错,请注意语言包问题)
- <?php
- $cdnurl = function_exists('config') ? config('view_replace_str.__CDN__') : '';
- $publicurl = function_exists('config') ? config('view_replace_str.__PUBLIC__') : '/';
- $debug = function_exists('config') ? config('app_debug') : false;
- $lang = [
- 'An error occurred' => '发生错误',
- 'Home' => '返回主页',
- 'Feedback' => '反馈错误',
- 'The page you are looking for is temporarily unavailable' => '你所浏览的页面暂时无法访问',
- 'You can return to the previous page and try again' => '你可以返回上一页重试,或直接向我们反馈错误报告'
- ];
- $langSet = '';
- if (isset($_GET['lang'])) {
- $langSet = strtolower($_GET['lang']);
- } elseif (isset($_COOKIE['think_var'])) {
- $langSet = strtolower($_COOKIE['think_var']);
- } elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
- preg_match('/^([a-z\d\-]+)/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches);
- $langSet = strtolower($matches[1]);
- }
- $langSet = $langSet && in_array($langSet, ['zh-cn', 'en']) ? $langSet : 'zh-cn';
- $langSet == 'en' && $lang = array_combine(array_keys($lang), array_keys($lang));
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
- <title><?=$lang['An error occurred']?></title>
- <meta name="robots" content="noindex,nofollow" />
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
- <link rel="shortcut icon" href="<?php echo $cdnurl;?>/assets/img/favicon.ico" />
- <style>
- * {-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}
- html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,caption,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video {margin:0;padding:0;border:0;outline:0;vertical-align:baseline;background:transparent;}
- article,aside,details,figcaption,figure,footer,header,hgroup,nav,section {display:block;}
- html {font-size:16px;line-height:24px;width:100%;height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;overflow-y:scroll;overflow-x:hidden;}
- img {vertical-align:middle;max-width:100%;height:auto;border:0;-ms-interpolation-mode:bicubic;}
- body {min-height:100%;background:#edf1f4;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",微软雅黑,Arial,sans-serif;}
- .clearfix {clear:both;zoom:1;}
- .clearfix:before,.clearfix:after {content:"\0020";display:block;height:0;visibility:hidden;}
- .clearfix:after {clear:both;}
- body.error-page-wrapper,.error-page-wrapper.preview {background-position:center center;background-repeat:no-repeat;background-size:cover;position:relative;}
- .error-page-wrapper .content-container {border-radius:2px;text-align:center;box-shadow:1px 1px 1px rgba(99,99,99,0.1);padding:50px;background-color:#fff;width:100%;max-width:560px;position:absolute;left:50%;top:50%;margin-top:-220px;margin-left:-280px;}
- .error-page-wrapper .content-container.in {left:0px;opacity:1;}
- .error-page-wrapper .head-line {transition:color .2s linear;font-size:40px;line-height:60px;letter-spacing:-1px;margin-bottom:20px;color:#777;}
- .error-page-wrapper .subheader {transition:color .2s linear;font-size:32px;line-height:46px;color:#494949;}
- .error-page-wrapper .hr {height:1px;background-color:#eee;width:80%;max-width:350px;margin:25px auto;}
- .error-page-wrapper .context {transition:color .2s linear;font-size:16px;line-height:27px;color:#aaa;}
- .error-page-wrapper .context p {margin:0;}
- .error-page-wrapper .context p:nth-child(n+2) {margin-top:16px;}
- .error-page-wrapper .buttons-container {margin-top:35px;overflow:hidden;}
- .error-page-wrapper .buttons-container a {transition:text-indent .2s ease-out,color .2s linear,background-color .2s linear;text-indent:0px;font-size:14px;text-transform:uppercase;text-decoration:none;color:#fff;background-color:#2ecc71;border-radius:99px;padding:8px 0 8px;text-align:center;display:inline-block;overflow:hidden;position:relative;width:45%;}
- .error-page-wrapper .buttons-container a:hover {text-indent:15px;}
- .error-page-wrapper .buttons-container a:nth-child(1) {float:left;}
- .error-page-wrapper .buttons-container a:nth-child(2) {float:right;}
- @media screen and (max-width:580px) {
- .error-page-wrapper {padding:30px 5%;}
- .error-page-wrapper .content-container {padding:37px;position:static;left:0;margin-top:0;margin-left:0;}
- .error-page-wrapper .head-line {font-size:36px;}
- .error-page-wrapper .subheader {font-size:27px;line-height:37px;}
- .error-page-wrapper .hr {margin:30px auto;width:215px;}
- }
- @media screen and (max-width:450px) {
- .error-page-wrapper {padding:30px;}
- .error-page-wrapper .head-line {font-size:32px;}
- .error-page-wrapper .hr {margin:25px auto;width:180px;}
- .error-page-wrapper .context {font-size:15px;line-height:22px;}
- .error-page-wrapper .context p:nth-child(n+2) {margin-top:10px;}
- .error-page-wrapper .buttons-container {margin-top:29px;}
- .error-page-wrapper .buttons-container a {float:none !important;width:65%;margin:0 auto;font-size:13px;padding:9px 0;}
- .error-page-wrapper .buttons-container a:nth-child(2) {margin-top:12px;}
- }
- </style>
- </head>
- <body class="error-page-wrapper">
- <div class="content-container">
- <div class="head-line">
- <img src="<?=$cdnurl?>/assets/img/error.svg" alt="" width="120"/>
- </div>
- <div class="subheader">
- <?=$debug?$message:$lang['The page you are looking for is temporarily unavailable']?>
- </div>
- <div class="hr"></div>
- <div class="context">
- <p>
- <?=$lang['You can return to the previous page and try again']?>
- </p>
- </div>
- <div class="buttons-container">
- <a href="<?=$publicurl?>"><?=$lang['Home']?></a>
- <a href="<?=$publicurl?>"><?=$lang['Feedback']?></a>
- </div>
- </div>
- </body>
- </html>
over!over!over!
使用fastadmin的页面异常模板的更多相关文章
- Python之路-(js正则表达式、前端页面的模板套用、Django基础)
js正则表达式 前端页面的模板套用 Django基础 js正则表达式: 1.定义正则表达式 /.../ 用于定义正则表达式 /.../g 表示全局匹配 /.../i 表示不区分大小写 /.../m ...
- 在PHP与HTML混合输入的页面或者模板中就需要对PHP代码进行闭合
PHP程序的时候会在文件的最后加上一个闭合标签,如下: <?phpclass MyClass{public function test(){//do something, etc.}}?> ...
- Asp.net 页面访问模板页的属性
首先 页面需要添加下面一段代码 <%@ MasterType VirtualPath="~/User/User.Master" %> 添加的位置如图 这样就可以在这个页 ...
- html模板生成静态页面及模板分页处理
它只让你修改页面的某一部分,当然这"某一部分"是由你来确定的.美工先做好一个页面,然后我们把这个页面当作模板(要注意的是这个模板就没必要使用EditRegion3这样的代码了,这种 ...
- FastAdmin 前端页面传参笔记
FastAdmin 前端页面传参笔记 看到 QQ 群里的小伙伴询问如何传参,然后在社区里找到一笔记帖子 1 还要参考在线文档控制器部分2. 引用 Karson 的回复: 如果我们需要自己在控制器中透传 ...
- 使用fastadmin的页面跳转模板
1.效果图 2.修改tp默认跳转模板文件( /thinkphp/tpl/dispatch_jump.tpl ),将文件中的内容全部替换成下面的内容然后保存即可,注意替换语言包和图片路径 {__NOLA ...
- 第一篇:fastadmin的页面是如何生成的?
第一步: 访问URL http://www.fastadmin.cc/admin/mydir/test/index?addtabs=1 对应的方法是admin模块,controller文件夹下的myd ...
- fastadmin的页面是如何生成的?
第一步: 访问URL http://www.fastadmin.cc/admin/mydir/test/index?addtabs=1 对应的方法是admin模块,controller文件夹下的myd ...
- ch1-使用路由-静态资源-404页面-ejs模板
1 package.json 项目文件夹根目录创建这个文件 //要依赖的模块 "dependencies": { //dependency 依赖的复数形式 "expres ...
随机推荐
- 关于mongorc.js文件详解
最近阅读了<<mongodb权威指南第二版>>,发现这本书比之前的第一版好,很多地方讲解很详细.下面就翻译下谈下这个文件. 首先,启动shell的时候,mongorc.js文件 ...
- Oracle比较时间大小
1,比较当前时间与指定时间相差分钟数: select sysdate, sysdate - to_date('2007-04-03 13:45:39','yyyy-mm-dd hh24:mi: ...
- 数据结构基础之memset---有memset 抛出的int 和 char 之间的转换和字节对齐
今天晚上,在做滤波算法时,里面用到很多float 和int 以及char 之间的类型强制转换,后面滤波完发现图片有些区域块,有过度曝光的白光,我就跟踪,以为是char 字符数字数据溢出问题,加了0-2 ...
- js中变量的声明
大家都知道js中变量的声明是要提前的,下面有4个样例: 1.if(!"t" in window){ var t = 1; } alert(t);答案是undefine ...
- uGUI动态加载控件位置错误(转自:https://www.cnblogs.com/mezero/p/4542939.html)
最近在使用uGUI时遇到了一个问题,在此记录一下.在Canvas的Render Mode设置为Screen Space-Overlay模式时,动态加载控件是不会发生问题的.但是在Screen Spac ...
- ajax json html 结合
<table id="datas" border="1" cellspacing="0" style="border-col ...
- ArcGIS10和ArcGIS10.1关于AO Licence初始化的问题
两个版本主要是esriLicenseProductCode.esriLicenseProductCodeArcInfo和esriLicenseProductCode.esriLicenseProduc ...
- linux定期判断网站可否打开
wget http://www.shopindream.de/200.php --timeout=2 c_monitor=$? rm -rf 200.php if [ ! $c_monitor = ...
- NSString和NSMutableNSString的基本用法
// // main.m // NSString /** NSString 1.NSString 是一个不可以变的字符串对象 2.NSMutableString是一个可变字符串. 下面代码为字符串的: ...
- Vue实例和方法
github地址:https://github.com/manlili/vue_learn里面的lesson03 一 实例 每个 Vue 实例都会代理其 data 对象里所有的属性,改变data,vu ...