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