Brophp sets the 404 method for sharing. Today, a classmate asked me how to set 404 in brophp. here I will share with you Method 1. prepare a 404 page template and place it under the public directory of the root directory, of course, you can define the path by yourself. Today, a student asked me how to set "404" in brophp. here I will share some ideas.
1. prepare a 404 page template and put it under the public directory of the root directory. of course, you can define the path yourself.
2. first add this method to 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/100 ');
}
3. in brophp/brophp. in php, find $ srccontrolerfile = APP_PATH. "controls /". strtolower ($ _ GET ["m"]). ". class. php "; add the following code:
If (! File_exists ($ srccontrolerfile )){
Action: _ 404 ();
}
4. open action. class. php and find the Debug: addmsg ("No {$ _ GET [" a "]} operation! ");
Add above or below this line:
Self: _ 404 ();
OK!
Step 1: Prepare a 404 page template and put it under the public directory of the root directory. of course, you can define the path yourself...