1. Go to this page and download the library: Download bonfim/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/ */
bonfim / router example snippets
use Bonfim\Router\Route;
Route::get('/', function () {
echo 'Hello World!';
});
Route::get('/', function () {
echo 'Hello World!';
});
function hello()
{
echo 'Hello World!';
}
Route::get('/', 'hello');
class Greeting
{
public static function hello()
{
echo 'Hello World!';
}
}
Route::get('/', ['Greeting', 'hello']);
class Greeting
{
private $name;
public function __construct()
{
$this->name = 'Edson Onildo';
}
public function hello()
{
echo 'Hello, {$this->name}!';
}
}
$greeting = new Greeting();
Route::get('/', [$greeting, 'hello']);