Code splitting routes slim v3

Hello Community

I am trying code split my routes so I have all my routes in a folder called Controllers and then inside my index files I want to have the different routes that gets called.

So lets say I have a route called /users if that gets called then it will get all the logic from the usersController.

I have read about using containers but I was wondering if this is right approach.

Not sure if i understand your question, but your route doesn’t include logic of Controllers. It calls the Controller. If you show me your current routes i may be able to help your further.

In general, you can put all your routes in one file, call it routes.php. Then include that in your index.php file, this way it looks cleaner. Then call your Controllers within the route and put them all in your Controllers dir.