PHPackages                             zabachok/yii2-onion-url - 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. zabachok/yii2-onion-url

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

zabachok/yii2-onion-url
=======================

Url rule class to make github-like urls.

025PHP

Since Mar 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/zabachok/yii2-onion-url)[ Packagist](https://packagist.org/packages/zabachok/yii2-onion-url)[ RSS](/packages/zabachok-yii2-onion-url/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-onion-url
==============

[](#yii2-onion-url)

Url rule class to make github-like urls.

Layers
------

[](#layers)

Uri is composite of three layers like ogre :)

First layer is user name. Example: `zabachok`
Second layer is project name. Example: `toolka`
Third layer is free route. Example: `task/108`

All layers are collected in one line in uri:
First layer: `/zabachok`
Second layer: `/zabachok/toolka`
Third layer: `/zabachok/toolka/task/108`

You can make route to each layer independently.

Configure
---------

[](#configure)

Add to rules section in UrlManager configuration:

```
[
    'class' => zabachok\onionUrl\UrlRule::class,
    'provider' => YourProvider::class,
    'userRoute' => 'user/view',
    'projectRoute' => 'project/view',
    'rules' => [
        'settings' => 'project/settings',
        'tasks' => 'task/index',
        'task/' => 'task/view',
        'task//update' => 'task/update',
    ],
],
```

**provider** - class implements ProviderInterface. It is needs to rule can to check exists that user or project.
**userRoute** - first layer: field with route to user page.
**projectRoute** - second layer: field with route to project page.
**rules** - third layer: array with your custom routes. In this section you can use standard yii2 routes.

Example with full UrlManager configuration:

```
'urlManager' => [
    'cache' => YII_ENV_DEV ? false : 'cache',
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'enableStrictParsing' => true,
    'rules' => [
        '' => 'site/index',
        'login' => 'user/login',
        'logout' => 'user/logout',
        [
            'class' => zabachok\onionUrl\UrlRule::class,
            'provider' => YourProvider::class,
            'userRoute' => 'user/view',
            'projectRoute' => 'project/view',
            'rules' => [
                'settings' => 'project/settings',
                'tasks' => 'task/index',
                'task/' => 'task/view',
                'task//update' => 'task/update',
            ],
        ],
    ],
],
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![zabachok](https://avatars.githubusercontent.com/u/966135?v=4)](https://github.com/zabachok "zabachok (3 commits)")

### Embed Badge

![Health badge](/badges/zabachok-yii2-onion-url/health.svg)

```
[![Health](https://phpackages.com/badges/zabachok-yii2-onion-url/health.svg)](https://phpackages.com/packages/zabachok-yii2-onion-url)
```

###  Alternatives

[joaopaulolndev/filament-edit-env

Package to edit env file

322.5k](/packages/joaopaulolndev-filament-edit-env)

PHPackages © 2026

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