Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Lots of resources in rest controller
  • I'm using Controller_Rest to build a REST API. I have many resources so the controller (Controller_Api) is getting huge. I was thinking of splitting the controller up into one controller per resource. Instead of having Controller_Api in classes/controller/api.php I would have a controller for each resource in classes/controller/api/ I'm not sure if this is a good idea or not. Controller_Rest also doesn't appear to support this since it always looks for method_resource functions. I would probably just have a function for each method Is there a simple way to do this or should I just add this functionality to Controller_Rest? Or is there a better way I could structure the code? Thanks
  • If you create a folder called 'api' in which you have multiple controllers, that would translate to URI's like '/api/controllername/...' which implements the split of controllers without any further action needed.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion