1. Go to this page and download the library: Download jonahh/omniroute 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/ */
jonahh / omniroute example snippets
use OmniRoute\Router;
function() {
echo "Welcome to the homepage!";
});
Router::registerErrorCallback(OMNI_404, function($path) {
echo "Error 404: The path $path was not found.";
});
Router::registerErrorCallback(OMNI_405, function($path, $method) {
echo "Error 405: The method $method is not allowed for $path.";
});
Router::run();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.