Link to the official documentation

The routes can be found in the folder routes. This folder contains a 'Loader.php' file in the root and a subfolder named 'singleton' with
the actual router scripts. A router script is build as a class with the following structure:

namespace Routes\Singleton;

class Web
    function register($app, $container)
       $app->get('/', function ($request, $response) {
            return 'Slim works great';

If you create new router scripts you can simply add them to the 'singleton' folder. All scripts in this folder will be loaded automatically.

Be careful not to have the same route redundant in more than one file, otherwise it will lead to unexpected results.

Last update: Thu, 15 Mar 2018 9:45:19