thinkphp Error Handling

Source: Internet
Author: User

1, when running the result hint: Can't find the page (Controller), what to do?

Build an empty page: Emptycontroller

1<?PHP2 namespace Home\controller;3  UseThink\controller;4 classEmptycontrollerextendsController5 {6     function_empty ()7     {8         Echo"Controller does not exist"; 9     }Ten}

2, when running the result hint: Can't find this method, how to do?

Build an empty method: _empty ()

1<?PHP2 namespace Home\controller;3  UseThink\controller;4 classCeshicontrollerextendsController5 {6     7     function_empty ()//The _empty () method is called by default when the calling method does not exist, preventing information disclosure8     {9         Echo"Method does not exist"; Ten     } One      A     functionShuchu () -     { -         /*//Build Objects the $index = new Maincontroller (); - echo $index->x (); -          - //a method of making objects + $index =a ("Main"); - echo $index->x (); +          A //r method, create object, and call a special method at Echo R ("main/x");*/ -          -         //cross-module invocation -         EchoR ("admin/test/t"); -     } -}

thinkphp Error Handling

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.