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 1mo ago

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

15

—

LowBetter than 3% of packages

Maintenance33

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://www.gravatar.com/avatar/a948b392f945061f12e02eac6a4e614f3fec312d84d1319597e3a9ce11a3964e?d=identicon)[AminebajjiDEV](/maintainers/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

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M315](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M291](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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