PHPackages                             grephq/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. grephq/php-router

ActiveProject[Framework](/categories/framework)

grephq/php-router
=================

Dynamic routing framework in php

1.0.1(3y ago)955MITPHP

Since Jul 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Tomiwa-Ot/php-router)[ Packagist](https://packagist.org/packages/grephq/php-router)[ RSS](/packages/grephq-php-router/feed)WikiDiscussions main Synced 1mo ago

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

PHP Router
==========

[](#php-router)

[![Latest Stable Version](https://camo.githubusercontent.com/c2f98d57beab26cfc5e5bbfd48e9a8676c7abc02888172891178b4c4df8850a4/687474703a2f2f706f7365722e707567782e6f72672f6772657068712f7068702d726f757465722f76)](https://packagist.org/packages/grephq/php-router) [![Total Downloads](https://camo.githubusercontent.com/266cac3879a59149774532455a4e45beb3c3b4ffd1e082e40989b00c448c10ba/687474703a2f2f706f7365722e707567782e6f72672f6772657068712f7068702d726f757465722f646f776e6c6f616473)](https://packagist.org/packages/grephq/php-router) [![Latest Unstable Version](https://camo.githubusercontent.com/39552c9a443278ee8c93552420631e05509bc24b8dba9cf6f0ddf84a2f7eeb8d/687474703a2f2f706f7365722e707567782e6f72672f6772657068712f7068702d726f757465722f762f756e737461626c65)](https://packagist.org/packages/grephq/php-router) [![License](https://camo.githubusercontent.com/b2f9e22a6ea029a686ea87717bb62c09a25b15b0f975ceca95a5e740d3b58909/687474703a2f2f706f7365722e707567782e6f72672f6772657068712f7068702d726f757465722f6c6963656e7365)](https://packagist.org/packages/grephq/php-router)

Features
--------

[](#features)

- Static routes
- Dynamic routes
- Pass variables in the URI
- Multiple HTTP methods
- Custom error handling
- Enable/Disable error reporting
- Request logging

Usage
-----

[](#usage)

### Routes

[](#routes)

Routes are defined in `app.php`

```
$route->get('/users', function() {
    Index::get();
});

$route->post('/user/', function() {
    Index::post();
});

$route->delete('/user/', function() {
    Index::delete();
});
```

### Defining Controllers

[](#defining-controllers)

Controllers are defined in `Controllers/`

```
class User extends BaseController
{
    public static function get()
    {
        render('index.php', array('title' => 'Index Page'));
    }

    public static function post()
    {
        json(reqVar('name'), 200);
    }

    public static function delete()
    {
        xml('Delete Request', 200);
    }
}
```

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

[](#installation)

Via Git

```
git clone https://github.com/Tomiwa-Ot/php-router.git
cd php-router
composer install
```

Via Composer

```
composer create-project grephq/php-router
cd php-router
composer install
```

Docs
----

[](#docs)

-
-

Example
-------

[](#example)

License
-------

[](#license)

MIT License

Copyright (c) 2023 Olorunfemi-Ojo Tomiwa

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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

Every ~247 days

Total

2

Last Release

1155d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bcec0de52dec50a97887495134d9ac7fbb4ab7178905991bb33bc0495a527b4a?d=identicon)[Tomiwa-Ot](/maintainers/Tomiwa-Ot)

---

Top Contributors

[![Tomiwa-Ot](https://avatars.githubusercontent.com/u/37912743?v=4)](https://github.com/Tomiwa-Ot "Tomiwa-Ot (101 commits)")

---

Tags

dynamic-routingframeworklearnphpphp-frameworkphp-routerphp-routingrouter

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/grephq-php-router/health.svg)](https://phpackages.com/packages/grephq-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)
