1. Go to this page and download the library: Download reinink/roundabout 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/ */
reinink / roundabout example snippets
use \Reinink\Roundabout\Router;
use \Symfony\Component\HttpFoundation\Request;
// Include Composer autoloader
// Home page
$router->get(
'/',
function () {
// do something
}
);
// Contact page
$router->get(
'/contact',
function () {
// do something
}
);
// Process form post
$router->post(
'/form-submit',
function () {
// do something
}
);
// Secure (HTTPS) page
$router->getSecure(
'/login',
function () {
// do something
}
);
// PUT request
$router->put(
'/resource',
function () {
// do something
}
);
// DELETE request
$router->delete(
'/resource',
function () {
// do something
}
);
// User profile
$router->get(
'/user/([0-9]+)',
function ($userId) {
// do something with $userId
}
);
// Output image
$router->get(
'/photo/(xlarge|large|medium|small|xsmall)/([0-9]+)',
function ($imageSize, $imageId) {
// do something with $imageSize and $imageId
}
);
// Home page
$router->get('/', 'Controller::index');
// Contact page
$router->get('/contact', 'Controller::contact');
// Process form post
$router->post('/form-submit', 'Controller::process_form');
// Secure (HTTPS) page
$router->getSecure('/login', 'Controller::login');