<>1, Handling method of exception throw without directory

stay tp6 in ,app There is a public file named provider.php. If our hierarchical directory is divided into admin,index and api Three levels , Encounter the throw of unknown exception ,api What is needed is json format , The others are not needed . So we can put ExceptionHandle.php in render Stripping out .

This is the way to deal with it api Exception throw of technical secondary school . as for apiArr This method is what I'm doing here common A self-defined one in the file json Throw method .

<>2, How to write well , But it doesn't work

The method is written , It's done , But not implemented . This is the time to use tp6 Of provide This document is missing .
We put app Under the directory provide.php file , Copy paste to api Under the table of contents , And modify the configuration in the box
<?php use app\ExceptionHandle; use app\Request; // container Provider Definition file return [
'think\exception\Handle' => 'app\\api\\exception\\Http', ];
Note the use of double slashes here . Then you can get the data , In Figure 1, I pass a 1123 Value of
That's it

©2019-2020 Toolsou All rights reserved,
( Super detail )Eclipse Using tutorials —— use Eclipse Create first HelloWorld! Database operation 5 code implementation mysql Addition, deletion, modification and query of database What can MCU do , Do you have any interesting works made by MCU or open source hardware Go to the interview after reading this , Steady over ~~ Single linked list of primary data structure (C Language implementation )SQL Comprehensive questions Employee unit comprehensive questions Python Implementation of Hanoi Tower code VHDL——JK trigger It's over , Starting salary 30k