PHPackages                             kaio-souza/php-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. [Framework](/categories/framework)
4. /
5. kaio-souza/php-router

ActiveN[Framework](/categories/framework)

kaio-souza/php-router
=====================

A simple PHP router

0.01(3y ago)34MITPHP

Since May 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/kaio-souza/php-router)[ Packagist](https://packagist.org/packages/kaio-souza/php-router)[ RSS](/packages/kaio-souza-php-router/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

php-router
==========

[](#php-router)

A simple PHP router

HOW TO CONFIGURE ENVIROMENT
---------------------------

[](#how-to-configure-enviroment)

To use the router, you will need to rewrite all requests to a single file in which you create an instance of the router class.

#### Apache .htaccess

[](#apache-htaccess)

```
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

```

#### Nginx nginx.conf

[](#nginx-nginxconf)

```
try_files $uri /index.php;

```

HOW TO RUN EXAMPLE
------------------

[](#how-to-run-example)

On the project folder run

```
php -S localhost:8080 -t ./example

```

Using the Router
----------------

[](#using-the-router)

### Instantiate Router

[](#instantiate-router)

```
$router = new Router();
```

### Creating Route

[](#creating-route)

```
$router->get('/xpto', function(){
    echo 'Hello World';
});
```

### Creating Route with Param

[](#creating-route-with-param)

```
$router->get('/xpto/{param}', function($param){
    echo $param;
});
```

### Listen Requests

[](#listen-requests)

Add it on final of file

```
$router->listen();
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1452d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/962b7ae1edee171afab45eae5c6bf6a6356c80e776bc491bd1a9edbb07758a78?d=identicon)[kaleu62](/maintainers/kaleu62)

---

Top Contributors

[![kaio-souza](https://avatars.githubusercontent.com/u/16223766?v=4)](https://github.com/kaio-souza "kaio-souza (3 commits)")

### Embed Badge

![Health badge](/badges/kaio-souza-php-router/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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