thinkphp 404 Page Setup method
This article mainly describes the thinkphp 404 Page Setup method, the need for friends can refer to the following
In many web sites will have 404 pages, how to set in the thinkphp framework, then I introduce one of the methods
1, the first to establish a EmptyAction.class.php module under the Lib/action
The contents are as follows:
The code is as follows:
/*
* @author Rocky
* @date 20141021
* @desc empty module 404 and other Errors
* */
Class Emptyaction extends Commonaction {
function _empty () {
Header ("http/1.0 404 Not Found");
$this->display (' public:404 ');
}
}
?>
2, finish the above processing, only access to the empty module when access to 404 pages, so, in order to access the empty method also access to 404 pages, we also need to add an empty method in CommonAction.class.php, the method is as follows:
The code is as follows:
Handle all methods that are not in the process, booting to page 404
Public Function _empty () {
R (' Empty/_empty ');
}
3, finish the above work basically can, but don't forget to put your 404.html page under Tpl/public
This will be OK, OK, take the team to collect the team! ~~~
http://www.bkjia.com/PHPjc/971930.html www.bkjia.com true http://www.bkjia.com/PHPjc/971930.html techarticle thinkphp 404 Page Setup Method This article mainly introduces the thinkphp 404 page of the setting method, the need for friends can refer to the following in many sites will have the use of 404 pages, in ...