开发者

Zend Rest Controller for api and web together

开发者 https://www.devze.com 2023-01-23 22:39 出处:网络
Does anyone have experience implementing an api with Zend framework? I see it\'s possible to implement index, get, post, put, delete for the api, then implement new and edit actions for the web in the

Does anyone have experience implementing an api with Zend framework? I see it's possible to implement index, get, post, put, delete for the api, then implement new and edit actions for the web in the same controller. But is this a good idea? I want开发者_JAVA技巧 to know if this implementation has been tested enough that people don't get problems with it down the road.


I've had success using the Context Helper to give 'API' access using the same URI structure as the 'normal' site. Then API consumers just have to POST data like a normal form. Depending on the complexity of your needs, that might work for you.

Also, it should be noted that Zend provides a REST router that may be useful.

0

精彩评论

暂无评论...
验证码 换一张
取 消