Guillaume ORIOL wrote: > > http://app.domain.com/<account>/<module>/<controller>/<action> > > Now, I need to configure the routes in order to set a specific module as > REST. > How can I do so? > The first thing you will want to check when attempting to match a rest route is whether or not you are trying the correct URI.
For example: This Uri will likely not match via the rest route: app.domain.com/<account>/<module>/<controller>/<action> but based on what I see in your route configuration, the following should match: app.domain.com/rest (indexAction) app.domain.com/rest/id (getAction) app.domain.com/rest/id/edit (editAction) app.domain.com/rest/new (newAction) ... If you want a dynamic <account> parameter, you'll likely have to chain the rest route with the hostname route. I don't believe there is a way for the rest route to match unless the first segment (where you currently have <account>) corresponds to a module directory. On the other hand, the default route will look at the first segment, and if there is no module directory that matches, it will use the default module and use the first segment as the controller. I am not sure if the rest router does this as well (I suspect it does but I haven't tested it), but if it does, you should be able to put your rest controller under your default module directory to get it to work. If you are having trouble figuring out how to test this, post back on what you are having trouble with. BTW, even if the above works, I'm not sure you'll be able to get the name of the module as it may be replaced by the name of the default module. Again, I'm not sure so you'll have to test for that. If none of this works, you may have better luck writing the rest routes from scratch (means you'll have to manually test for the correct HTTP method). ----- -- Wil Moore III Why is Bottom-posting better than Top-posting: http://www.caliburn.nl/topposting.html DO NOT TOP-POST and DO trim your replies: http://linux.sgms-centre.com/misc/netiquette.php#toppost -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/adding-a-REST-route-chained-with-another-route-tp3297415p3302597.html Sent from the Zend Framework mailing list archive at Nabble.com.