How to judge is not Pravite function?

Source: Internet
Author: User
How to judge is not Pravite function??
For example, the CI framework, we invoke the pravite decorated function from the controller on the URL. It will jump to the 404_error interface. How is it implemented?

Share to:


------Solution--------------------
A private method function cannot be accessed externally, and when the method that finds the request does not exist, it turns 404. It's not hard to do, is it?

$p = new Class;
if (! method_exists ($p)) {
Header ("http/1.0 404 Not Found")
Exit
}

No matter what the framework, you can modify it is just a callback (or plug-in) of the main control program
You don't write anything, and it doesn't affect the normal functioning of the framework.
  • 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.