agrandesr/router

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

Installs: 6

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/agrandesr/router

0.1 2024-02-11 12:21 UTC

This package is auto-updated.

Last update: 2025-09-22 11:21:22 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 Agrandesr\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');