PHPackages                             openlss/lib-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. openlss/lib-router

ActiveLibrary[Framework](/categories/framework)

openlss/lib-router
==================

Router for handling web calls, allows dynamic registration at runtime

0.0.8(13y ago)0124LGPL-3.0+PHPPHP &gt;=5.3.2

Since Mar 23Pushed 13y ago1 watchersCompare

[ Source](https://github.com/nullivex/lib-router)[ Packagist](https://packagist.org/packages/openlss/lib-router)[ Docs](http://openlss.org)[ RSS](/packages/openlss-lib-router/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (10)Used By (0)

openlss/lib-router
==================

[](#openlsslib-router)

Router for handling web calls, allows dynamic registration at runtime

Usage
-----

[](#usage)

```
use \LSS\Router;

Router::init();
Router::_get()->setRoot(ROOT);
Router::_get()->setDefault('/ctl/home.php');
Router::_get()->register('client','list'=>'/ctl/client_list.php');
$dest = Router::_get()->route(get('act'),get('do'),get('fire'));
require($dest);
```

Reference
---------

[](#reference)

### (void) Router::init()

[](#void-routerinit)

Calls the construct and starts the singleton

### (object) Router::\_get()

[](#object-router_get)

Returns the current instance

### (string) Router::setDefault($dest)

[](#string-routersetdefaultdest)

Sets the default file to route too. Relative to root.

### (string) Router::setRoot($root)

[](#string-routersetrootroot)

Set the root folder that all route calls are relative to.

### (object) Router::register($act,$do=array())

[](#object-routerregisteractdoarray)

- $act The first routing argument
- $do An array of secondary routing arguments
- Do may also contain arrays of "fire" routing calls The router is tertiary

A more in depth example

```
Router::_get()->register('client',array(
	 'list'		=>	'/ctl/client_list.php'
	,'edit'		=>	'/ctl/client_edit.php'
	,'create'	=>	'/ctl/client_create.php'
	,'manage'	=>	array( //this is a tiertiary segment
		'contacts'		=>	'/ctl/client_manage_contacts.php'i
		 //set the default when the third segment is missing
		Router::DEF		=>	'/ctl/client_manage.php'
	)
	//set the default when the second segment is missing
	,Router::DEF	=>	'/ctl/client_list.php'
));
```

### (string) Router::route($act=null,$do=null,$fire=nul)

[](#string-routerrouteactnulldonullfirenul)

- $act The first routing segment usually a get variable
- $do The second routing segement usually a get variable
- $fire The thrist routing segment Returns the controller to route to which should then be sent to require()

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

Total

8

Last Release

4831d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/83c8e9d55e3ebafb0621a441a51af8f551f61a274fde5400459a29cc320b7b75?d=identicon)[nullivex](/maintainers/nullivex)

![](https://www.gravatar.com/avatar/afffa5c56642e74ba5b880c4b78e115c1b8d00c74ceae5644ac359d10058a911?d=identicon)[spudz76](/maintainers/spudz76)

---

Top Contributors

[![nullivex](https://avatars.githubusercontent.com/u/2321375?v=4)](https://github.com/nullivex "nullivex (7 commits)")

---

Tags

routercall handlingdynamic routingroute defaults

### Embed Badge

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

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

###  Alternatives

[slim/slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

12.3k51.8M1.4k](/packages/slim-slim)[klein/klein

A lightning fast router for PHP

2.7k1.1M31](/packages/klein-klein)[slim/slim-skeleton

A Slim Framework skeleton application for rapid development

1.6k462.3k6](/packages/slim-slim-skeleton)[pecee/simple-router

Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.

675224.9k18](/packages/pecee-simple-router)[rareloop/router

A powerful PHP Router for PSR7 messages inspired by the Laravel API

92184.1k5](/packages/rareloop-router)[yiisoft/router

Yii router

62343.6k26](/packages/yiisoft-router)

PHPackages © 2026

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