sullivan
sullivan

Reputation: 6823

Zend Rest Controller for api and web together

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 to know if this implementation has been tested enough that people don't get problems with it down the road.

Upvotes: 3

Views: 1742

Answers (1)

Tim Lytle
Tim Lytle

Reputation: 17624

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.

Upvotes: 3

Related Questions