Today a classmate asked me how to set 404 in brophp. I will share the method here
1. Prepare a 404 page template yourself and place it under public in the root directory. Of course, you can define the path yourself.
2. First add such a method in action.class.php:
static public function _404(){
header("HTTP/1.0 404 Not Found");
header("status: 404 Not Found");
$my = new self();
$my->display('public/404');
}
3. Find $srccontrolerfile = APP_PATH."controls/".strtolower($_GET["m"]).".class.php" in brophp/brophp.php; add the following code after it:
if(!file_exists($srccontrolerfile)){
Action::_404();
}
4, then open action.class.php and find Debug::addmsg("There is no {$_GET["a"]} operation!") ;
Add above or below this line:
self::_404();
OK, done!