Slim Framework: routes and controllers
Originally, my Slim Framework app had the classic structure (index.php) <?php $app = new \Slim\Slim(); $app->get('/hello/:name', function ($name) { echo "Hello, $name"; }); $app->run(); But as I added more routes and groups of routes, I moved to a controller based approach: index.php <?php $app = new \Slim\Slim(); $app->get('/hello/:name', 'HelloController::hello'); $app->run(); HelloController.php <?php class HelloController { public static function hello($name) { echo "Hello, $name"; } } This works, and it had been helpful to organize my app structure, while at the same time lets me build