日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

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

發布時間:2023/12/2 php 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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)

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

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

  • ????</head>

  • ????<body>
  • ????<div?class="message">

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

  • ????<div?class="content">

  • ????<?php?if(isset($message))?{?>

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

  • ????<?php?}else{?>

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

  • ????<?php?}?>

  • ????<p?class="detail"></p>

  • ????<p?class="jump">

  • ????<a?id="href"?href="<?php?echo($jumpUrl);??>">如果你的瀏覽器沒有自動跳轉,請點擊這里...</a>

  • ????<br?/>

  • ????等待時間:?<b?id="wait"><?php?echo($waitSecond);??></b>

  • ????</p>

  • ????</div>

  • ????</div>

  • ????<script?type="text/javascript">

  • ????(function(){

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

  • ????var?interval?=?setInterval(function(){

  • ????var?time?=?--wait.innerHTML;

  • ????if(time?<=?0)?{

  • ????location.href?=?href;

  • ????clearInterval(interval);

  • ????};

  • ????},?1000);

  • ????})();

  • ????</script>

  • ????</body>

  • ????</html>
  • 復制代碼

    詳細內容請點擊http://www.jb100.net/html/content-28-252-1.html

    轉載于:https://www.cnblogs.com/shsgl/p/5474070.html

    總結

    以上是生活随笔為你收集整理的thinkphp3.2自定义success及error跳转页面的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。