pijush_gupta/php-router

Simple Php Router

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/pijush_gupta/php-router

dev-main 2022-12-29 17:28 UTC

This package is auto-updated.

Last update: 2025-09-29 02:59:34 UTC


README

Php Router

Clone this repository
git clone https://github.com/Pijushgupta/php-router.git
Adding it to the project
include_once 'Location of file';
OR use Composer/auto-loader
composer require pijush_gupta/php-router:dev-main
Using it in the project
use phpRouter\Router;
new Router('/', function () {
	echo 'Home';
});
Get method with Parameters
https://example.com?a=Pijush&b=Gupta
new Router('/',function($a,$b){ //exact number of variables and name as query vars from url.
	echo $a . $b;
})
Post method
https://example.com/
new Router('/',function($post){ //variable name for the param can be anything
	var_dump($post);
});