搜索
系统检测到您的用户名不符合规范:

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

浏览:40277 发布日期:2014年11月13日 分类:功能实现 关键字: 自定义提示页面 success
默认的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
评论() 相关
后面还有条评论,
评论支持使用[code][/code]标签添加代码
您需要登录后才可以评论 登录 | 立即注册
收藏
jxxyyang
积分:353 等级:LV2
热点推荐
(追記) (追記ここまで)
最新更新

我们

合作

网站

信息

ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。

AltStyle によって変換されたページ (->オリジナル) /