kiss-php/router

This is a KISS router and I try to keep it simple.

v1.0.1 2025-01-01 19:04 UTC

This package is not auto-updated.

Last update: 2025-05-07 20:43:26 UTC


README

Requirements:

  • PHP >7.4
  • Composer (vendor autoload)

To install you execute:

composer install ...

To start to use add the routes in your index.php file.

require 'vendor/autoload.php';

use Kiss\Http\Router;

Router::use('', 'Agrandesr\EasyRouter\Controllers\User'); //Function default main
Router::use('get','Agrandesr\EasyRouter\Controllers\User::get');
Router::use('update','Agrandesr\EasyRouter\Controllers\User::update');

If you want to create relative path you can use brackets.

Router::use('update/{id}','Agrandesr\EasyRouter\Controllers\User::update');

Next, you can use this relative path with the static function getOption.

$id = Router::getOption('id');