Unable to load template file 'rj\ThinkPHP/Tpl/dispatch_jump.tpl'----thinkphp3.2.3

1.报错原因:将thinkphp默认模板引擎改为smarty模板引擎,导致调用success()和error()方法失败。

2.解决方案一:

找到ThinkPHP\Library\Think\Controller.class.PHP文件中的protected function error()和protected function success()方法,替换为如下代码~~

/******************************************************代码部分**************************************************************************************/

protected function error($message='',$jumpUrl='',$waitSecond) {
 
$info = <<<eof
<!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: 16px; }
.system-message{ padding: 24px 48px; }
.system-message h1{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 12px; }
.system-message .jump{ padding-top: 10px}
.system-message .jump a{ color: #333;}
.system-message .success,.system-message .error{ line-height: 1.8em; font-size: 36px }
.system-message .detail{ font-size: 12px; line-height: 20px; margin-top: 12px; display:none}
</style>
</head>
<body>
<div class="system-message">
<present name="message">
<h1>):</h1>
<p class="success">$message</p>
</present>
<p class="detail"></p>
<p class="jump">
页面自动 <a id="href" href="$jumpUrl">跳转</a> 等待时间: <b id="wait">$waitSecond</b>
</p>
</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>            
eof;
echo $info;
exit;        
//$this->dispatchJump($message,0,$jumpUrl,$ajax);
    }

/**
     * 操作成功跳转的快捷方法
     * @access protected
     * @param string $message 提示信息
     * @param string $jumpUrl 页面跳转地址
     * @param mixed $ajax 是否为Ajax方式 当数字时指定跳转时间
     * @return void
     */
    protected function success($message='',$jumpUrl='',$waitSecond) {
        
$info = <<<eof
<!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: 16px; }
.system-message{ padding: 24px 48px; }
.system-message h1{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 12px; }
.system-message .jump{ padding-top: 10px}
.system-message .jump a{ color: #333;}
.system-message .success,.system-message .error{ line-height: 1.8em; font-size: 36px }
.system-message .detail{ font-size: 12px; line-height: 20px; margin-top: 12px; display:none}
</style>
</head>
<body>
<div class="system-message">
<present name="message">
<h1>:)</h1>
<p class="success">$message</p>
</present>
<p class="detail"></p>
<p class="jump">
页面自动 <a id="href" href="$jumpUrl">跳转</a> 等待时间: <b id="wait">$waitSecond</b>
</p>
</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>            
eof;
echo $info;
exit;
        //$this->dispatchJump($message,1,$jumpUrl,$ajax);
    }

/******************************************************代码部分**************************************************************************************/

Unable to load template file 'rj\ThinkPHP/Tpl/dispatch_jump.tpl'----thinkphp3.2.3的更多相关文章

  1. 报错:Unable to load configuration. - action - file:/E:/apache-tomcat-8.0.37/webapps/20161102-struts2-3/WEB-INF/classes/struts.xml:11:73

    第一种报错: 严重: Exception starting filter struts2Unable to load configuration. - action - file:/E:/apache ...

  2. 关于报malformed or corrupted AST file: 'Unable to load module 的错~

    今天早上 一运行程序 居然报错,我都惊呆了,昨天明明好好的-但是百度是强大的- 报错内容: malformed or corrupted AST file: 'Unable to load modul ...

  3. iOS 使用XCode6打开项目以后再用XCode5出现的问题fatal error: malformed or corrupted AST file: 'Unable to load module

    使用不同版本的XCode出现的问题: fatal error: malformed or corrupted AST file: 'Unable to load module "/Users ...

  4. 出现错误:Unable to load configuration. - action - file:/E:/Java/Tomcat7.0/apache-tomcat-7.0.68-windows-x64/apache-tomcat-7.0.68/webapps/SSH2Integrate/WEB-INF/classes/struts.xml:8:43

    严重: Exception starting filter struts2 Unable to load configuration. - action - file:/E:/Java/Tomcat7 ...

  5. fatal error: malformed or corrupted AST file: &#39;Unable to load module &quot;/Users/apple/Library/Developer

    在同一时候安装使用Xcode5, Xcode6之后, 常常遇到这个问题. fatal error: malformed or corrupted AST file: 'Unable to load m ...

  6. java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class org.

    1.错误描述 严重: Exception starting filter struts2 java.lang.UnsupportedClassVersionError: Bad version num ...

  7. Unable to load configuration. - action - file:/F:/apache-tomcat-8.0.30/webapps/test1Struts2/WEB-INF/classes/struts.xml:11:71

    Unable to load configuration. - action - file:/F:/apache-tomcat-8.0.30/webapps/test1Struts2/WEB-INF/ ...

  8. 关于ImportError: libssl.so.10: cannot open shared object file: No such file or directory unable to load app 0 (mountpoint='') (callable not found or import error)

    一.问题描述 在亚马逊云服务器使用Nginx+uwsgi部署django项目时,项目可以使用python manage.py runserver正常运行,uwsgi测试也没问题,Nginx也正常启动, ...

  9. hive sequencefile导入文件遇到FAILED: SemanticException Unable to load data to destination table. Error: The file that you are trying to load does not match the file format of the destination table.错误

    hive sequencefile导入文件遇到FAILED: SemanticException Unable to load data to destination table. Error: Th ...

随机推荐

  1. jQuery - parents() 获得最近的祖先元素方法

    答案 : parents()[0] <div class="pg-ins layer p_close"> <div class="sign_con&qu ...

  2. python菜鸟基础知识(一)

    第三章 基础 3.1程控制语句 3.1.1if语句 1.单if ​ if 关键字 空格 条件 冒号 ​ 缩进 结果 print(1) if 3 > 2: print(9) print(8) 2 ...

  3. 运用KeyCode在浏览器中按WASD使图形运动

    如何实现在浏览器中按WASD四个键使图形上下左右运动呢? 其实很简单,用keyCode方法就可以实现了. 先放个div在html中: <div id="ball" style ...

  4. java多线程总结-同步容器与并发容器的对比与介绍

    1 容器集简单介绍 java.util包下面的容器集主要有两种,一种是Collection接口下面的List和Set,一种是Map, 大致结构如下: Collection List LinkedLis ...

  5. 地图组件demo

    高德地图API(demo未完善) 1:声请JSAPI的key值:http://lbs.amap.com/dev/#/(已声请key名称:demo-javascipt key:7cbbed2d9a0c0 ...

  6. 《VR入门系列教程》之22---GearVR SDK代码剖析

    GearVR SDK代码剖析     接下来我们来了解一下GearVR开发包的底层代码,它底层的代码和之前在第三章中讲的桌面SDK代码非常类似,当然,也有许多不同的地方.     首先,我们看看如何构 ...

  7. Atlassian In Action-Jira之推荐插件(四)

    前面的几章基本已经完整构建了Jira的管理平台,并且有了一套比较完成的制度和方法.但是优化是永无止境的,我们作为研发管理人员,需要让系统使用起来更加高效和便捷.为了达到这个目的一般有两种途径,插件和开 ...

  8. 黑羽压测 做 API接口功能测试

    做功能测试 黑羽压测 是一款性能测试工具,但是我们也可以使用它,很方便的做 API接口功能测试 . 点击下方链接,观看 讲解视频 https://www.bilibili.com/video/av60 ...

  9. 高级查询语句____ Mysql

    MySQL高级查询 高级查询 关键字书写顺序  关键字执行顺序select:投影结果       1    5 from:定位到表             2    1 where:分组前第一道过滤  ...

  10. string的学习

    原:https://blog.csdn.net/qq_37941471/article/details/82107077 一. string的构造函数的形式: string str:生成空字符串 st ...