Unable to load template file 'rj\ThinkPHP/Tpl/dispatch_jump.tpl'----thinkphp3.2.3
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的更多相关文章
- 报错: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 ...
- 关于报malformed or corrupted AST file: 'Unable to load module 的错~
今天早上 一运行程序 居然报错,我都惊呆了,昨天明明好好的-但是百度是强大的- 报错内容: malformed or corrupted AST file: 'Unable to load modul ...
- 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 ...
- 出现错误: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 ...
- fatal error: malformed or corrupted AST file: 'Unable to load module "/Users/apple/Library/Developer
在同一时候安装使用Xcode5, Xcode6之后, 常常遇到这个问题. fatal error: malformed or corrupted AST file: 'Unable to load m ...
- 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 ...
- 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/ ...
- 关于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也正常启动, ...
- 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 ...
随机推荐
- Bzoj 3166 [Heoi2013] Alo 题解
3166: [Heoi2013]Alo Time Limit: 20 Sec Memory Limit: 256 MBSubmit: 1118 Solved: 518[Submit][Status ...
- Python入门基础(9)__面向对象编程_2
__str__方法 如果在开发中,希望使用print输出对象变量时,能够打印自定义的内容,就可以利用__str__这个内置方法了 注意:__str__方法必须返回一个字符串 class Cat(): ...
- something good
CF292A CF304B CF383A CF409D CF409F CF632A CF652B CF656A CF656B CF656D CF659A CF678A CF697A CF735D CF ...
- spring全局异常抓取validation校验信息
@ControllerAdvicepublic class GlobalExceptionHandler { @ExceptionHandler({Exception.class}) @Respons ...
- JAVA面试题 线程的生命周期包括哪几个阶段?
面试官:您知道线程的生命周期包括哪几个阶段? 应聘者: 线程的生命周期包含5个阶段,包括:新建.就绪.运行.阻塞.销毁. 新建:就是刚使用new方法,new出来的线程: 就绪:就是调用的线程的star ...
- Prometheus 整合 AlertManager
简介 Alertmanager 主要用于接收 Prometheus 发送的告警信息,它很容易做到告警信息的去重,降噪,分组,策略路由,是一款前卫的告警通知系统.它支持丰富的告警通知渠道,可以将告警信息 ...
- Spring WebClient vs. RestTemplate
1. 简介 本教程中,我们将对比 Spring 的两种 Web 客户端实现 -- RestTemplate 和 Spring 5 中全新的 Reactive 替代方案 WebClient. 2. 阻塞 ...
- [NSNull intValue]: unrecognized selector sent to instance 0x375c9860
今天遇到这个问题,程序崩溃了……日志如下: -[NSNull intValue]: unrecognized selector sent to instance 0x375c9860*** Termi ...
- 再记一次经典Net程序的逆向过程
1.前言 上次发完,有网友问了一个问题:如果不绕过编译,而是直接编译怎么办? 记一次Net软件逆向的过程:https://www.cnblogs.com/dotnetcrazy/p/10142315. ...
- gitee+hexo搭建个人博客
通过gitee和hexo搭建个人博客 首先准备软件: git (提供命令git) git官网 notepad++(方便编辑)notepad++官网 nodejs(hexo依赖)nodejs官网 7z( ...