yakisova41/routing

Installs: 54

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/yakisova41/routing

4.0.3 2022-07-13 16:31 UTC

This package is auto-updated.

Last update: 2025-10-13 23:20:05 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