Unable to load template file ' rj\thinkphp/tpl/dispatch_jump.tpl '----thinkphp3.2.3
1. Error reason: The thinkphp default template engine was changed to Smarty template engine, causing the call to success () and the error () method to fail.
2. Solution One:
Locate the protected function error () and protected function success () methods in the thinkphp\library\think\controller.class.php file, replacing them with the following code ~~
/****************************************************** Code Section **************************************************** **********************************/
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 ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title> Jump Tips </title>
<style type= "Text/css" >
*{padding:0; margin:0;}
body{background: #fff; font-family: ' Microsoft Jas Black '; 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>
<body>
<div class= "System-message" >
<present name= "Message" >
<p class= "Success" > $message </p>
</present>
<p class= "Detail" ></p>
<p class= "Jump" >
Page Auto <a id= "href" href= "$jumpUrl" > Jump </a> Wait Time: <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>
Eof
Echo $info;
Exit
$this->dispatchjump ($message, 0, $JUMPURL, $ajax);
}
/**
* Quick way to successfully jump the operation
* @access protected
* @param string $message tip information
* @param string $JUMPURL page jump Address
* @param mixed $ajax Whether to specify the jump time when the number is the AJAX mode
* @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 ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title> Jump Tips </title>
<style type= "Text/css" >
*{padding:0; margin:0;}
body{background: #fff; font-family: ' Microsoft Jas Black '; 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>
<body>
<div class= "System-message" >
<present name= "Message" >
<p class= "Success" > $message </p>
</present>
<p class= "Detail" ></p>
<p class= "Jump" >
Page Auto <a id= "href" href= "$jumpUrl" > Jump </a> Wait Time: <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>
Eof
Echo $info;
Exit
$this->dispatchjump ($message, 1, $JUMPURL, $ajax);
}
/****************************************************** Code Section **************************************************** **********************************/
Unable to load template file ' rj\thinkphp/tpl/dispatch_jump.tpl '----thinkphp3.2.3