TP Frame Settings 404 page

Source: Internet
Author: User

Unable to load template jump to page 404
/thinkphp/library/think/dispatcher.class.php in 176 rows
To load the module's extension configuration file
Load_ext_file (Module_path);
}else{
Header ("location:/404.html");d ie;
E (L (' _module_not_exist_ '). ': '. MODULE_NAME);
}
Plus the header jump page, 404.html on the following


Unable to load controller jump to 404 page
Create a EmptyController.class.php code as follows
<?php
namespace Home\controller;
Use Think\controller;
Class Emptycontroller extends Controller
{
Public Function _empty () {
$this->display (' error/404 ');//In the Error folder in Home/view
}
}
That's it.
Unable to load method jump to 404 page
In/thinkphp/library/think/controller.class.php 170 line plus redirect 404 page
Public Function __call ($method, $args) {
if (0 = = strcasecmp ($method, Action_name. C (' Action_suffix '))) {
if (method_exists ($this, ' _empty ')) {
If the _empty operation is defined, the call
$this->_empty ($method, $args);
}elseif (File_exists_case ($this->view->parsetemplate ())) {
Check if there is a default template if there is a direct output template
$this->display ();
}else{
$this->display (' error/404 ');
E (L (' _error_action_ '). ': '. Action_name);
}
}else{
E (__class__. ': '. $method. L (' _method_not_exist_ '));

Return

}

}

---------------------This article from the Great Lao Wang's blog, reprinted to 54943723

TP Frame Settings 404 page

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.