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

Source: Internet
Author: User
Tags smarty template

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.