Want to implement a simple Restfull API with PHP
Find PHP is not nodejs as easy to control routing rules, routing is controlled by Apache
Can you give me some advice? How do I control routing to implement restful APIs?
Reply content:
Want to implement a simple Restfull API with PHP Find PHP is not nodejs as easy to control routing rules, routing is controlled by Apache
Can you give me some advice? How do I control routing to implement restful APIs?
Http://frapi.github.io/developing/creati ... Generate API interfaces directly in the background
No rules for routing must be given to Apache! You can implement a restful interface by assembling all requests to the unified portal, and then parsing the URI and method of the request and dispatching it to the corresponding interface API program. Many PHP frameworks are also developed specifically for restful, such as slim. And most of the PHP framework also supports restful routing, and the implementation looks at their code.
Yii/laravel Frame
You can use such redirection rules to forward files that cannot be found to index.php
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.