How to Develop APIs using ThinkPHP?

Source: Internet
Author: User
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.

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.