PHP code example of juliogomes26297 / slim-route

1. Go to this page and download the library: Download juliogomes26297/slim-route library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

juliogomes26297 / slim-route example snippets

 php
$route = new Route;
 php
// Iniciar o controlador LandingController como página inicial
$route->get('', \SlimRoute_Test\Controllers\LandingController::class, 'hello');
 php
// Exemplo de buscar parametros na url
$route->add('GET', '/utilizador/{user_id:[0-9]+}', \SlimRoute_Test\Controllers\UserController::class, 'get');
 php
$route->fallback(\SlimRoute_Test\Controllers\NotFoundController::class, 'get');
 put()