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

ActiveLibrary[Framework](/categories/framework)

intec/simple-router
===================

A simple router for small php projects

0581PHP

Since May 17Pushed 7y ago3 watchersCompare

[ Source](https://github.com/incluirtecnologia/SimpleRouter)[ Packagist](https://packagist.org/packages/intec/simple-router)[ RSS](/packages/intec-simple-router/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (4)Used By (0)

Simple Router for php &gt;= 5.6.
================================

[](#simple-router-for-php--56)

[![Build Status](https://camo.githubusercontent.com/1cd94874d309941a959893cfab1e4efa20a02b0a60ecaf86f0262242bacc5787/68747470733a2f2f7472617669732d63692e6f72672f696e636c7569727465636e6f6c6f6769612f53696d706c65526f757465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/incluirtecnologia/SimpleRouter)

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

[](#how-to-install)

`composer require 'intec/simple-router';`

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

[](#how-to-use)

```
use LibrasSAC\Router\SimpleRouter;

// add route '/hello'
SimpleRouter::add('/hello', function(){
	echo 'Hello!';
});

// match route hello
SimpleRouter::match('/hello');

// add route '/hello/'
SimpleRouter::add('/hello/([a-zA-Z]*)', function($request){
	$name = request->getUrlParams()[0];
	echo "Hello $name!";
});

// match route hello/. It Will print 'Hello Jorge!'
SimpleRouter::match('/hello/jorge');

// add multiple routes once
SimpleRouter::setRoutes([
	[
		'pattern' => '/my/name/is/([a-zA-Z]*)',
        	'middlewares' => [
		    function(request) {
			// middleware stuff
			// if you want to block the request at this point
			// you will need to use a redirect or exit.
			// Otherwise the router will call the next middleware
		    },
		    function($request) {
			// middleware 2
			// if you want to block the request at this point
			// you will need to use a redirect or exit
		    }
        ]
		'callback' => function($request) {
            $name = request->getUrlParams()[0];
			echo $name;
		}
	],
	[
		'pattern' => '/my/id/([0-9+])',
		'callback' => function($request) {
            $id = request->getUrlParams()[0];
			echo $id;
		}
	]
]);
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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/c931800f2b74296e13ab1f8d10310c48a9285555c7c6f9b757d88f28b481af37?d=identicon)[incluirtecnologia](/maintainers/incluirtecnologia)

---

Top Contributors

[![marciodojr](https://avatars.githubusercontent.com/u/4480634?v=4)](https://github.com/marciodojr "marciodojr (18 commits)")[![incluirtecnologia](https://avatars.githubusercontent.com/u/3707332?v=4)](https://github.com/incluirtecnologia "incluirtecnologia (2 commits)")[![DiegoRibeiro](https://avatars.githubusercontent.com/u/5454539?v=4)](https://github.com/DiegoRibeiro "DiegoRibeiro (1 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M841](/packages/laravel-socialite)[laravel/dusk

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

1.9k38.6M289](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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