View Full Version : CodeIgniter and RESTful stores

Thomas Triplet
6 Aug 2010, 7:41 AM
Most MVCs, CodeIgniter in particular, are based on URI of the form http://base_url/controller/function/param1/param2/...

So instead of DELETE, PUT, GET requests, I'd the store to send request like this:


I tried to setup the store's restful param to true, but it didn't help. Any suggestion?

7 Aug 2010, 4:04 AM
Configuring the store with an api and restful:true should already generate the first 2 urls you mention.

The last 2 are not supported by default and would require you to write your own buildUrl method.

Thomas Triplet
7 Aug 2010, 6:44 PM
Thanks Condor. Sorry if this sounds like a stupid question, but I haven't found buildUrl(). I was thinking of using setUrl() (or setApi() ) in the request() method of the HttpProxy. Is that a valid approach or is there a better way to do this? I'm guessing I could also create my own proxy by extending the HttpProxy

7 Aug 2010, 11:33 PM
The easiest method is probably to use setUrl from the beforeload/beforewrite event.