Brophp setting 404 method sharing today, a student asked me how to set 404 in brophp. here I will share Method 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 in action. class. php to brophp and set the 404 method for sharing.
Today, a classmate asked me how to set up 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!
Weibo: @ anzhengchao