PHPackages                             tinylara/tinyrouter - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tinylara/tinyrouter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tinylara/tinyrouter
===================

Tiny PHP router based on Macaw.

v2.2(10y ago)196581MITPHPPHP &gt;=5.4.0

Since Jan 14Pushed 10y ago4 watchersCompare

[ Source](https://github.com/TinyLara/TinyRouter)[ Packagist](https://packagist.org/packages/tinylara/tinyrouter)[ RSS](/packages/tinylara-tinyrouter/feed)WikiDiscussions master Synced 1mo ago

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

TinyLara\\TinyRouter
====================

[](#tinylaratinyrouter)

[![Latest Stable Version](https://camo.githubusercontent.com/01978e8fb6087accedf4840401198d4c67fbea45f8061e71f6d72a5f00f4570d/68747470733a2f2f706f7365722e707567782e6f72672f74696e796c6172612f74696e79726f757465722f762f737461626c652e737667)](https://packagist.org/packages/tinylara/tinyrouter) [![Total Downloads](https://camo.githubusercontent.com/102dba9abf5161e13b5b8af469406e5cdbf9c36e3436de30ddf76dada68ec99e/68747470733a2f2f706f7365722e707567782e6f72672f74696e796c6172612f74696e79726f757465722f646f776e6c6f6164732e737667)](https://packagist.org/packages/tinylara/tinyrouter) [![License](https://camo.githubusercontent.com/28cd352902442d4d9ced0e35261377a01d3cc898818ee351a8e4dfab53d631c1/68747470733a2f2f706f7365722e707567782e6f72672f74696e796c6172612f74696e79726f757465722f6c6963656e73652e737667)](https://packagist.org/packages/tinylara/tinyrouter)

TinyRouter is a tiny PHP router based on [Macaw](https://github.com/NoahBuscher/Macaw). [Read the documentation.](https://github.com/TinyLara/TinyLara/wiki/Routing)

### Install

[](#install)

If you have Composer, just include TinyRouter as a project dependency in your `composer.json`. If you don't just install it by downloading the .ZIP file and extracting it to your project directory.

```
require: {
    "tinylara/tinyrouter": "*"
}

```

### Examples

[](#examples)

```
use TinyLara\TinyRouter\TinyRouter as Route;

Route::get('/', 'HomeController@home');

// GET
Route::get('foo', function() {
  echo "GET Foo!";
});
// POST
Route::post('foo', function() {
  echo "POST Foo!";
});
// ANY: GET or POST
Route::any('foo', function() {
  echo "ANY Foo!";
});

Route::error(function() {
  throw new Exception("404 Not Found");
});

Route::dispatch();
```

The `Route::dispatch()` function can receive a parameter as the Processor After. It will process the value returned by Controller. Example:

```
Route::dispatch('View@process');
```

If you don't specify an error callback, it will just echo `404`. ### License

[](#license)

The TinyRouter is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~70 days

Total

5

Last Release

3857d ago

Major Versions

v1.1 → v2.02015-03-12

PHP version history (2 changes)v1.0PHP &gt;=5.3.3

v2.2PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2127912?v=4)[吕文翰](/maintainers/JohnLui)[@johnlui](https://github.com/johnlui)

---

Top Contributors

[![johnlui](https://avatars.githubusercontent.com/u/2127912?v=4)](https://github.com/johnlui "johnlui (17 commits)")

### Embed Badge

![Health badge](/badges/tinylara-tinyrouter/health.svg)

```
[![Health](https://phpackages.com/badges/tinylara-tinyrouter/health.svg)](https://phpackages.com/packages/tinylara-tinyrouter)
```

PHPackages © 2026

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