Setting the site's error page is also a very important link.
One, empty operation
Adding E_empty operations to the current controller
Public function _empty () { $this->error (' method not present ');} Public Function Index () { }
Test method:
Normal:
Http://localhost/thinkphp/index/index/index
Error: "Method does not exist" will be prompted
Http://localhost/thinkphp/index/index/df
Two, empty controller
Create an error controller under the module,
Location: index/error.php Related parameters: Empty_controller
Code:
<? PHP /* */namespace app\index\controller;use App\index\controller; class Error extends indexbase{ public function Index () { ' The controller being accessed does not exist '; }}
Test: Http://localhost/thinkphp/index/inde3dfx/index
Third, exception error thrown
The ability to affect it is the configuration file under the current module. If the current profile is not valid, the configuration parameters under the public module are automatically locked
Related parameters: Exception_tmpl,error_message
// template file for exception page ' Exception_tmpl ' ' TPL ' ' THINK_EXCEPTION.TPL ',
THINKPHP5 Note Seven: Set error page ①