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

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

jacko/router
============

Simple router

v0.3(9y ago)0241MITPHPPHP &gt;=5.4.0

Since Nov 19Pushed 9y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (3)Used By (1)

Simple Router
=============

[](#simple-router)

[![Latest Stable Version](https://camo.githubusercontent.com/f4f85986c51b19871e461b645ae28b72406d4df4ced70dc2507921c43fd2b3a8/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b6f2f726f757465722f762f737461626c65)](https://packagist.org/packages/jacko/router)[![Latest Unstable Version](https://camo.githubusercontent.com/5f6e1e5df79b7b54da730daac15258cb414b89838d928f500b0cacfce1fa9310/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b6f2f726f757465722f762f756e737461626c65)](https://packagist.org/packages/jacko/router)[![Total Downloads](https://camo.githubusercontent.com/69358fbb8a7db7c36db857c62ab1c2388cbceb715d83a753a03323f3c82f04ad/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b6f2f726f757465722f646f776e6c6f616473)](https://packagist.org/packages/jacko/router)[![License](https://camo.githubusercontent.com/6fa5c6ef9ffb76a5a37ccb99d744d8ed3dead19123da0e1628afaa70170e8d43/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b6f2f726f757465722f6c6963656e7365)](https://packagist.org/packages/jacko/router)

How to Install
--------------

[](#how-to-install)

Installation via composer is easy:

```
composer require jacko/router:dev-master

```

How to Use
----------

[](#how-to-use)

Write into your index.php:

```
require('vendor/autoload.php');
//
$router = new Jacko\Router();
$router->path = 'config/routes.php';
$router->start();
```

Check your .htaccess, it's must looking like that:

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

```

An Example Route
----------------

[](#an-example-route)

Place into your config/routes.php

```
Route::get('/', 'HomeController@index');
Route::any('/page', 'HomeController@page');
Route::post('/ajax', 'HomeController@ajax');

Route::get('/user/{id}', function($id) {
    var_dump($id);
});

Route::get('/{any}', 'HomeController@error404');
```

Dependency Injection in your Controllers
----------------------------------------

[](#dependency-injection-in-your-controllers)

Please, make sure that your Models contains call methods like all(), first(), etc

```
class HomeController
{
	public function __construct(User $user, Order $order)
	{
		$this->user = $user;
		$this->order = $order;
	}

	public function page(Page $page)
	{
		$users = $this->user->all();
		$home = $page->first();

		var_dump($users, $home);
	}
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

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

Total

3

Last Release

3462d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/051d84b5d2b2f1ab6e80210d092938b5a4bb8bf972f783661a3931159b42e3ab?d=identicon)[jacko](/maintainers/jacko)

---

Top Contributors

[![jacko](https://avatars.githubusercontent.com/u/8319994?v=4)](https://github.com/jacko "jacko (9 commits)")

---

Tags

phprouterSimple

### Embed Badge

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

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

###  Alternatives

[fab2s/souuid

Simple Ordered Uuid Generator in PHP

13573.2k1](/packages/fab2s-souuid)

PHPackages © 2026

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