PHPackages                             movisio/lazy-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. movisio/lazy-router

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

movisio/lazy-router
===================

Nette RouteList with capability of lazy loading routes with prefix

v0.11(3y ago)09.0k↓50%1MITPHPPHP ^7.4|^8.0

Since Aug 18Pushed 3y ago3 watchersCompare

[ Source](https://github.com/movisio/lazy-router)[ Packagist](https://packagist.org/packages/movisio/lazy-router)[ RSS](/packages/movisio-lazy-router/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Nette lazy router
=================

[](#nette-lazy-router)

Nette RouteList with capability of lazy loading routes.
It is usable especially when you have many (hundreds?) of routes, which slows your system and you don't need to load them all for every request.

For example, when your application have more independent modules and every module has its own routes, they can be separated and lazy loaded per-module.

Note that this router was created especially for hundreds of static routes for large API and should not be used for normal route `//`.

Usage
-----

[](#usage)

By default, LazyRouteList behaves exactly like ordinary RouteList. For lazy loading function, use `setLazyCachedRoutes` method. It has only one argument: callback for loading routes into cache. Return value of callback should be array of routers. Function also accepts argument $dependencies, just like nette Cache::load callback.

```
$router = new LazyRouteList($cache);
$router->setLazyCachedRoutes(function (&$dependencies) : array {

    // .... read routes from files or whatever ...
    $routes = [
        new \Nette\Routing\Route('/api/v1/route/to/resource', 'Module:ApiPresenter:action')
    ];

    // optional cache dependency for automatic cache invalidation and routes reloading
    $dependencies[\Nette\Caching\Cache::FILES] = ['path/to/file', 'path/to/another/file'];

    return $routes;
});
```

Routes will be separated into groups by static part of path (without parameters) and by presenters and will be cached.

When matching, router will load only routes with matching static part of path.
When creating links, only routes matching target presenter will be loaded from cache.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% 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 ~185 days

Total

3

Last Release

1364d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b17d4000958913c3b2c477a979832a974da7264194a29da6e4ce127802f9049?d=identicon)[Kocicak](/maintainers/Kocicak)

---

Top Contributors

[![Kocicak](https://avatars.githubusercontent.com/u/37833137?v=4)](https://github.com/Kocicak "Kocicak (7 commits)")[![jkavalik](https://avatars.githubusercontent.com/u/5812825?v=4)](https://github.com/jkavalik "jkavalik (2 commits)")

### Embed Badge

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

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

###  Alternatives

[pragmarx/countries

PHP Countries and Currencies

1.9k3.3M18](/packages/pragmarx-countries)[nette/code-checker

✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.

881.7M6](/packages/nette-code-checker)[contributte/menu-control

Menu control for Nette framework

29108.6k1](/packages/contributte-menu-control)

PHPackages © 2026

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