yakisova41/routing

4.0.3 2022-07-13 16:31 UTC

This package is auto-updated.

Last update: 2025-06-13 22:26:33 UTC


README

About

A composer package that allows you to set up simple routing

Usage

composer require yakisova41/routing
use Yakisova41\Routing\Routing;
use Yakisova41\Routing\Route;

Route::put('/',['GET'],function(){
    echo 'Hello world!!';
});

Routing::listen();

Set path parameters

Route::put('/page/{Pageid}',['GET'],function($req){
    echo $req['parameters']['Pageid'];
});

Executing this code will display the value specified in the path parameter Pageid

Specify request method

Route::put('/',['POST'],function(){
    echo 'Hello world!!';
});

Route::put('/',['GET', 'POST'],function(){
    echo 'Hello world!!';
});

Multiple request methods can be specified in the array