1. Go to this page and download the library: Download r-odriguez/tusk 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/ */
r-odriguez / tusk example snippets
const BASE_PATH = __DIR__ . '/../';
const BASE_PATH = __DIR__ . '/../';
import function can import an entire directory (only php files)
const route = new tusk\Route();
route->redirect(from: '/', to: '/home')
route->path('/home', '/home.php')
->path('/user/:age(number)', '/user/') // you can chain them
// use the Middleware abstract class to provide security. Look for the Middleware.php file so you
// know how it looks.
// MyAuthMiddle::class is defined inside ./src/middlewares/.
route->pathM('/user/:name(word)/profile', '/user/profile.php', MyAuthMiddle::class);