zoukankan      html  css  js  c++  java
  • thinkphp3.2自定义success及error跳转页面

    thinkphp3.2自定义success及error跳转页面

     
     

    默认的thinkphp success及error的默认模板不是很好看,下面分享如何自定义success及error页面,这里用的是thinkphp 3.2.2版本
    默认的thinkphp success及error的默认模板不是很好看,下面分享大家如何自定义success及error页面,这里用的是thinkphp 3.2.2版本
    首先在配置文件中添加以下代码(/Application/Admin/Conf/config.php)

    //自定义success和error的提示页面模板
    'TMPL_ACTION_SUCCESS'=>'Public:dispatch_jump',
    'TMPL_ACTION_ERROR'=>'Public:dispatch_jump',


    这里error和success是公用的一个模板文件,代码如下(/Application/Admin/View/Public/dispatch_jump.html)

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2.     <html xmlns="http://www.w3.org/1999/xhtml">
    3.     <head>
    4.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    5.     <title>跳转提示</title>
    6.     <style type="text/css">
    7.     *{ padding: 0; margin: 0; }
    8.     body{ background: #fff; font-family: '微软雅黑'; color: #333; font-size: 6px; }

    9.     .message{width: 400px;height: 150px;margin:auto;border:1px solid #1B8F24;margin-top: 30px;}
    10.     .head{width: 100%;height: 30px;background: rgb(222,245,194);text-align: center;padding-top: 5px;}
    11.     .content{height: 120px;width: 100%;}
    12.     .success ,.error{text-align: center;margin-top: 30px;}
    13.     .jump{text-align: center;margin-top: 20px;}
    14.     </style>

    15.     </head>

    16.     <body>
    17.     <div class="message">

    18.     <div class="head"><span>Ace Admin提示信息:</span></div>

    19.     <div class="content">

    20.     <?php if(isset($message)) {?>

    21.     <p class="success">:) <?php echo($message); ?></p>

    22.     <?php }else{?>

    23.     <p class="error">:( <?php echo($error); ?></p>

    24.     <?php }?>

    25.     <p class="detail"></p>

    26.     <p class="jump">

    27.     <a id="href" href="<?php echo($jumpUrl); ?>">如果你的浏览器没有自动跳转,请点击这里...</a>

    28.     <br />

    29.     等待时间: <b id="wait"><?php echo($waitSecond); ?></b>

    30.     </p>

    31.     </div>

    32.     </div>

    33.     <script type="text/javascript">

    34.     (function(){

    35.     var wait = document.getElementById('wait'),href = document.getElementById('href').href;

    36.     var interval = setInterval(function(){

    37.     var time = --wait.innerHTML;

    38.     if(time <= 0) {

    39.     location.href = href;

    40.     clearInterval(interval);

    41.     };

    42.     }, 1000);

    43.     })();

    44.     </script>

    45.     </body>

    46.     </html>
    复制代码

    详细内容请点击http://www.jb100.net/html/content-28-252-1.html

  • 相关阅读:
    【Vue原理】Compile
    vue v-cloak 的作用和用法
    vue中template的作用及使用
    Vue-router 嵌套路由
    Vue keep-alive实践总结
    Vuex入门(2)—— state,mapState,...mapState对象展开符详解
    mysql允许外部连接设置
    Swagger入门教程
    牛客枚举题---铺地毯
    牛客区间求和、枚举、贪心题---数学考试
  • 原文地址:https://www.cnblogs.com/shsgl/p/5474070.html
Copyright © 2011-2022 走看看