PHPackages                             weew/router-configurator - 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. weew/router-configurator

ActiveLibrary

weew/router-configurator
========================

Makes weew/router configurable trough config files.

v1.3.0(9y ago)010911MITPHP

Since Feb 9Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (7)Used By (1)

Router configurator
===================

[](#router-configurator)

[![Build Status](https://camo.githubusercontent.com/0b76b83ecb087646252b2b4b53753e0cd57ce72ad97b403f79252b0e4222fdf1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f776565772f726f757465722d636f6e666967757261746f722e737667)](https://travis-ci.org/weew/router-configurator)[![Code Quality](https://camo.githubusercontent.com/761e3242485cdceb591b100e20039eec7a7fc84d05ab04c64701f6a344e37fe7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f776565772f726f757465722d636f6e666967757261746f722e737667)](https://scrutinizer-ci.com/g/weew/router-configurator)[![Test Coverage](https://camo.githubusercontent.com/2fda06611a9f920082583156b686d335a06aef0570485a10bc0bfea6546e01ce/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f776565772f726f757465722d636f6e666967757261746f722e737667)](https://coveralls.io/github/weew/router-configurator)[![Version](https://camo.githubusercontent.com/3df73ee04d65976fb5804a60baa47dfcfdcb6d9f32f09e09559b92815fa3ed45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776565772f726f757465722d636f6e666967757261746f722e737667)](https://packagist.org/packages/weew/router-configurator)[![Licence](https://camo.githubusercontent.com/317c1dd0519bda7a640d2a17d377c671b280bfe1f841e36f8eb678bac5bb30a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f776565772f726f757465722d636f6e666967757261746f722e737667)](https://packagist.org/packages/weew/router-configurator)

Table of contents
-----------------

[](#table-of-contents)

Installation
------------

[](#installation)

`composer require weew/router-configurator`

Introduction
------------

[](#introduction)

This package makes the [weew/router](https://github.com/weew/router) configurable trough config files or arrays. It is recommended to use the [weew/config](https://github.com/weew/config) package for the loading of config files.

Usage
-----

[](#usage)

In this example I'll be using a configuration written in yaml:

```
# same as $router->addFilter('auth', [AuthFilter::class, 'filter');
filters:
    - name: auth
      filter: [Foo\Bar\AuthFilter, filter]

# same as $router->addResolver('user', [UserResolver::class, 'resolve');
resolvers:
    - name: user
      resolver: [Foo\Bar\UserResolver, resolve]

# same as $router->restrictProtocol(['http', 'https'])
protocol: [http, https]
# same as $router->restrictTLD(['com', 'net'])
tld: [com, net]
# same as $router->restrictDomain(['foo', 'bar'])
domain: [foo, bar]
# same as $router->restrictSubdomain(['foo', 'bar'])
subdomain: [foo, bar]
# same as $router->restrictHost(['foo.com'])
host: foo.com

# same as $router->group()
groups:
    # name is for readability only
    - name: public
      # same as $router->setController(HomeController::class)
      controller: HomeController
      routes:
        # same as $router->get('/', 'homeAction')
        - method: GET
          path: /
          action: homeAction
        # same as $router->route(['GET', 'POST'], 'contactAction')
        - method: [GET, POST]
          path: contact
          action: contactAction

    - name: api
      # same as $router->enableFilter('auth')
      filter: auth
      # same as $router->addPrefix('api/v1')
      prefix: api/v1

      groups:
       - name: users
         controller: Foo\Bar\UserController
         prefix: /users
         routes:
           - route: GET /
             action: list
           - route: POST /
             action: create
           - rotue: GET {user}
             action: show
           - route: PUT PATCH {user} update
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Recently: every ~67 days

Total

6

Last Release

3474d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10b2b854b5829dd13a15967c000ed2119b5faef67aca24d94c653c8ac550d85e?d=identicon)[weew](/maintainers/weew)

---

Top Contributors

[![mikeSimonson](https://avatars.githubusercontent.com/u/907613?v=4)](https://github.com/mikeSimonson "mikeSimonson (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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