Brophp sets up 404 method sharing

Source: Internet
Author: User
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:
  1. Static public function _ 404 (){
  2. Header ("HTTP/1.0 404 Not Found ");
  3. Header ("status: 404 Not Found ");
  4. $ My = new self ();
  5. $ My-> display ('public/100 ');
  6. }

3. in brophp/brophp. in php, find $ srccontrolerfile = APP_PATH. "controls /". strtolower ($ _ GET ["m"]). ". class. php "; add the following code:
  1. If (! File_exists ($ srccontrolerfile )){
  2. Action: _ 404 ();
  3. }

4. open action. class. php and find the Debug: addmsg ("No {$ _ GET [" a "]} operation! ");
Add above or below this line:
  1. Self: _ 404 ();

OK!
Weibo: @ anzhengchao


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.