I saw an api framework in the thinkphp framework. I want to know how to use it? What files must be included when using Thinkphp to develop APIs? One method is to use the database operation and controller of thinkphp to return data through the Controller, without using the view mode... I saw an api framework in the thinkphp framework. I want to know how to use it?
What files must be included when using Thinkphp to develop APIs?
One method is as follows:
The database operations and controllers using thinkphp return data through the Controller and do not need to use view templates. In this case, what files must be included? (I want to delete files that are not used as much as possible ).
Reply content:
I saw an api framework in the thinkphp framework. I want to know how to use it?
What files must be included when using Thinkphp to develop APIs?
One method is as follows:
The database operations and controllers using thinkphp return data through the Controller and do not need to use view templates. In this case, what files must be included? (I want to delete files that are not used as much as possible ).
Use thinkphp5
You can try the tp5 framework recommended upstairs, which is generated by calling the API.
The tp development api has a restcontroller. Read the topic of the Manual to explain the RESTful api and inherit the restcontroller.