<?php

$router->get([
    'route' => '/name/(name)',
    'object' => 'Example@getName',
    'require' => function() {
        return 1 + 1 == 2;
    }
]);

$router->post([
    'route' => '/name/(name)',
    'function' => ['functionExample', 'postName'],
    'require' => function() {
        return 1 + 1 == 2;
    }
]);
<?php

return function($router)
{

    $router->get([
        'route' => '/name/(name)',
        'object' => 'Example@getName',
        'require' => function() {
            return 1 + 1 == 2;
        }
    ]);

    $router->post([
        'route' => '/name/(name)',
        'function' => ['functionExample', 'postName'],
        'require' => function() {
            return 1 + 1 == 2;
        }
    ]);

};
Move routing into a separate function
Move routing into a separate function
