Zend Rest Controller for api and web together

Does anyone have experience implementing an api with a Zend card? I see that you can implement index, get, post, put, delete for api, and then implement new and edit actions for the Internet in one controller. But is that a good idea? I want to know if this implementation has been tested enough so that people do not encounter it on the road.

+3
source share
1 answer

I had success using the Context Helper to provide access to the API through the same URI structure as a regular site. Then the API users just have to receive the POST data, as a normal form. Depending on the complexity of your needs, this may work for you.

In addition, it should be noted that Zend provides a REST router , which can be useful.

+3
source

Source: https://habr.com/ru/post/1773291/


All Articles