1. Go to this page and download the library: Download sadiq-bd/alkane-php 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/ */
sadiq-bd / alkane-php example snippets
use Core\Router;
// Basic route
Router::get('/', function() {
return 'Hello World';
});
// Route with parameter
Router::get('/user/{id}', function($param) {
return 'User ID - ' . $param['id'];
});
// Route with controller
Router::get('/home', App\Controller\HomeController::class, 'method');