Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ptheofan/yii2-urlrule
An enhanced UrlRule class for Yii2 UrlManager
https://github.com/ptheofan/yii2-urlrule
Last synced: about 2 months ago
JSON representation
An enhanced UrlRule class for Yii2 UrlManager
- Host: GitHub
- URL: https://github.com/ptheofan/yii2-urlrule
- Owner: ptheofan
- Created: 2014-10-29T22:39:47.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-29T22:50:05.000Z (about 10 years ago)
- Last Synced: 2024-04-05T13:41:31.498Z (9 months ago)
- Language: PHP
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
UrlRule
=================
An enhanced UrlRule for Yii2 UrlManager component.Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist ptheofan/yii2-urlrule "*"
```or add
```
"ptheofan/yii2-urlrule": "*"
```to the require section of your `composer.json` file.
Usage
-----TODO: write usage examples.
In short, extend the /ptheofan/urlrule/UrlRule and override the getParamValue and the setParamValue. The rest
works exactly the same as the default UrlRule. With this approach you can write rules that still use all
of the default nice stuff like regexs, etc. and make them super flexible and also support named arguments
that work with Database, etc. Also by extending your own routes you can easily create partial url rules,
very helpful to remove code duplication and make maintenance easier.