PHPackages                             jinnguyen/puja-route - 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. jinnguyen/puja-route

ActiveLibrary[Framework](/categories/framework)

jinnguyen/puja-route
====================

Puja-Route is a router component, that allow to parse request to module/controller/action

v1.2.1(8y ago)044Apache License 2.0PHP

Since Feb 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jinnguyen/puja-route)[ Packagist](https://packagist.org/packages/jinnguyen/puja-route)[ RSS](/packages/jinnguyen-puja-route/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

puja-route
==========

[](#puja-route)

Puja-Route is a router component, that allow to parse request to module/controller/action

**Install**

```
composer require jinnguyen/puja-route
```

**Usage**

```
include /path/to/vendor/autoload.php;
$config = array(
    'root_namespace' => '\\Puja\\Route\\Demo\\', // You can change to match with controller class name on your app
    'default_controller' => 'Index', // Default controller
    'default_action' => 'index', // Default action
    'controller_dir' => __DIR__ . '/Controller/', // Folder that includes controllers, controller must have prefix is Controller and file type is .php (Ex:  UserController.php/IndexController.php, ...)
    'module_dir' => __DIR__ . '/Module/', // Folder that includes app modules
    'cache_dir' => __DIR__ . '/cache/', // Cache folder will store cached routers
);

$router = new Puja\Route\Route($config); // when you build, it will scan all file *Controller.php in $config[controller_dir] and /Controller/*Controller.php in $config[module_dir]
```

**Add more route**

If your controller is not in $config\[controller\_dir\] and $config\[module\_dir\]//Controller/, you can also add it to route by this command:

```
$route->addRoute('/testaddroute', '\\Test\\Add\\Route\\Namespace');
```

**Build**

Scan all controller files and build routes from $config\[controller\_dir\] and $config\[module\_dir\] and controllers that was added by $router-&gt;addRoute()

```
$router->build();
```

**Get route**

Get router information: module, controller, action, ..

```
$router->getRoute('testaddroute') // get route at  of testaddroute
```

Note:

- $router-&gt;getRoute() must run after $router-&gt;build() otherwise it will get exception
- Should call $router-&gt;build() after all $router-&gt;addRoute(), otherwise all added routes will be missed.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~91 days

Total

4

Last Release

3140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25e5bd31b5dd70d47cbdc738bded06dbabfba3d584acce63c2c4b4fb7847f39d?d=identicon)[jinnguyen](/maintainers/jinnguyen)

---

Top Contributors

[![linhnmt](https://avatars.githubusercontent.com/u/10231628?v=4)](https://github.com/linhnmt "linhnmt (4 commits)")[![linhnnmt](https://avatars.githubusercontent.com/u/162856460?v=4)](https://github.com/linhnnmt "linhnnmt (1 commits)")

---

Tags

routepuja

### Embed Badge

![Health badge](/badges/jinnguyen-puja-route/health.svg)

```
[![Health](https://phpackages.com/badges/jinnguyen-puja-route/health.svg)](https://phpackages.com/packages/jinnguyen-puja-route)
```

###  Alternatives

[pecee/simple-router

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

697231.0k18](/packages/pecee-simple-router)[izniburak/router

simple router class for php

23323.2k7](/packages/izniburak-router)[lesichkovm/laravel-advanced-route

Advanced route class for Laravel - restoring implicit controllers to the framework.

70144.6k1](/packages/lesichkovm-laravel-advanced-route)[ecoal95/php-router

Minimal routing library

271.0k1](/packages/ecoal95-php-router)[rosengate/exedra

Nestful route oriented PHP micro framework

142.0k1](/packages/rosengate-exedra)[developermarius/simple-router

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

112.5k](/packages/developermarius-simple-router)

PHPackages © 2026

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