开发者

Zend: What is the most common way to create Rest Zend routes?

I'm using default Zend_Rest_Route to generate Rest routes:

So given I just put resources.router.routes.rest.type = Zend_Rest_Route inside application.ini and now have Rest Routes for users

GET users
POST users
GET users/:id        
GET users/:id/edit   
PUT users/:id
DELETE users/:id

But how about nested resource开发者_如何学Gos? Given I need

users/:user_id/articles
users/:user_id/articles/:id
... etc

Is there any way to keep routes REST'y? Will appreciate any example of creating such nested routes

P.S. I'm using ZF version 1.10.8

Regards, M


I may be late here, but i want to answer your question.

As mentioned here, the creation of rest route configuration in application.ini may not work.

Coming to your point of the route configurations, you can use Zend_Controller_Router_Route_Regex for defining routes and corresponding mappings. Refer this question of myne. Might help you.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜