I'm used to build small to medium apps with something like 50kLoC.
I have no specific strategy so I usually end up with big routes files.
As you may know, Slim routes take a closure to handle the request and give the response:
$app=new\Slim\App();$app->any('/books/[{id}]',function($request,$response,$args){// do the stuff here});
Instead of having a big routes file, we have the possibility to define a controller class and to pass it to the \Slim\App:
I'm used to build small to medium apps with something like 50kLoC.
I have no specific strategy so I usually end up with big routes files.
As you may know, Slim routes take a closure to handle the request and give the response:
Instead of having a big routes file, we have the possibility to define a controller class and to pass it to the \Slim\App:
I never tried that but it's well described in the official doc.
You could install a DI container and do something like this