I’m new to cakephp. I’m using the 2.0.5 release, according it looks like rails on a large bunch of points it is pretty easy to get things done.
I’m currently using it to build an REST api for a game. It is easy to build an REST controller, but can’t find a way to get nested ressources.
I mean in rails it is easy like hell to get something like this : controller1/id/controller2/id.
I have an hard time to find a way to do this in cakephp. The mapresources method don’t seem to support multilevel rest api. Am i wrong?
How can i do a multi level rest API in cakephp 2?
So, i succeed to build my own generator.
According to the fact you provide an array(“parent_controller” => “child_controller”).
This way you can generate for superhero => superpowers
superheros/1/superpowers/ (here with or withouth ids according to your routes.
Args mappeds to method args so function index($superhero_id)