1. Go to this page and download the library: Download rgjoni/router 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/ */
rgjoni / router example snippets
Gjoni\Router
Router::setMap("MyAppNamespace\Controllers");
use Gjoni\Router\Router;
Router::get("/about", $handler);
Router::run();
use Gjoni\Router\Router;
Router::get("/", $handler);
use Gjoni\Router\Router;
Router::get("/groups/{id}", $handler);
Router::run();
use Gjoni\Router\Router;
Router::get("/groups/{group_id}/meetups/{meetup_id}", $handler);
use Gjoni\Router\Router;
Router::get("/me", function() {
/** some cool user experience */
});
Router::post("/settings/{setting_name}", function($id) {
/** some more magic */
});
Router::run();
use Gjoni\Router\Router;
Router::setNotFound(function() {
/** special error handling */
});
index.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.