PHPackages                             aminebajjidev/php\_simple\_router - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. aminebajjidev/php\_simple\_router

ActiveLibrary[HTTP &amp; Networking](/categories/http)

aminebajjidev/php\_simple\_router
=================================

This is simple router that can handle HTTP REQUESTS, named or anonymous functions, from the course Learn everthing you need to start a successful carrer as a PHP developer.

03PHP

Since Dec 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AminebajjiDEV/PHP_SIMPLE_ROUTER)[ Packagist](https://packagist.org/packages/aminebajjidev/php_simple_router)[ RSS](/packages/aminebajjidev-php-simple-router/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Description
-----------

[](#description)

This package was developed during my learning path in the COURSE \[PHP Course - beginner to Advanced\]

It's a simple Router for PHP to handle Requests.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require Aminedev\PhpSimpleRouter
```

Usage
-----

[](#usage)

You need to have a .htaccess file to redirect everything to your index.php

```
RewriteEngine On
RewriteBase /YourSRC
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php [QSA,L]
```

then inside the index.php you can use the router to handle or get/post/put/patch/delete

```
Router::handle("GET", "/contact", "contact.php");
```

or

```
Router::get("/contact", "contact.php");
```

or you can use predefined or anonymous functions

```
function testMe(){
    echo "this works as well!";
}
Router::get('/test', 'testMe');
```

or

```
 Router::get('/test', function(){
    echo "I'm in the function";
});
```

LIVE USAGE
----------

[](#live-usage)

- Composer Usage:

[![](https://github.com/AminebajjiDEV/PHP_SIMPLE_ROUTER/raw/main/Composer%20commande.png)](https://github.com/AminebajjiDEV/PHP_SIMPLE_ROUTER/blob/main/Composer%20commande.png)

- Working Package:

[![](https://github.com/AminebajjiDEV/PHP_SIMPLE_ROUTER/raw/main/Working%20Package.png)](https://github.com/AminebajjiDEV/PHP_SIMPLE_ROUTER/blob/main/Working%20Package.png)

Testing
-------

[](#testing)

this was developed for learning purposes. No tests have been written

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](./CHANGELOG.md) for more informations.

Contributing
------------

[](#contributing)

You can fork this project and add new features and send me pull requests.

License
-------

[](#license)

MIT License

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/121626195?v=4)[Amine](/maintainers/AminebajjiDEV)[@AminebajjiDEV](https://github.com/AminebajjiDEV)

---

Top Contributors

[![AminebajjiDEV](https://avatars.githubusercontent.com/u/121626195?v=4)](https://github.com/AminebajjiDEV "AminebajjiDEV (10 commits)")

### Embed Badge

![Health badge](/badges/aminebajjidev-php-simple-router/health.svg)

```
[![Health](https://phpackages.com/badges/aminebajjidev-php-simple-router/health.svg)](https://phpackages.com/packages/aminebajjidev-php-simple-router)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
