https://github.com/ibexa/templated-uri-router
https://github.com/ibexa/templated-uri-router
hacktoberfest
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ibexa/templated-uri-router
- Owner: ibexa
- License: mit
- Created: 2021-09-10T07:56:10.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-11T11:40:36.000Z (over 1 year ago)
- Last Synced: 2025-04-22T17:49:14.879Z (about 1 year ago)
- Topics: hacktoberfest
- Language: PHP
- Size: 28.3 KB
- Stars: 3
- Watchers: 13
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Hautelook Templated URI Router
==============================
Fork of `hautelook/templated-uri-router`. Symfony2 UrlGenerator that provides a [RFC-6570][RFC-6570] compatible router and URL Generator.
Currently it is extremely naive, and incomplete.
However, it does what we need it to do. Contributions are welcome.
[](https://travis-ci.org/hautelook/TemplatedUriRouter)
## Installation
Run the following command (assuming you have composer.phar or composer binary installed), or
require `ibexa/templated-uri-router` to your `composer.json` and run `composer install`:
```bash
$ composer require ibexa/templated-uri-router
```
## Usage
```yaml
# routing.yml
hautelook_demo_route:
pattern: /demo
```
```php
use Hautelook\TemplatedUriRouter\Routing\Generator\Rfc6570Generator as TemplateGenerator;
$templateGenerator = new TemplateGenerator($routes, $context);
$templatedUri = $templateGenerator->generate('hautelook_demo_route', array(
'page' => '{page}',
'sort' => array('{sort}'),
'filter' => array('{filter}'),
));
```
This will produce a link similar to:
```
/demo{?page,sort*,filter*}
```
## Bundle
The symfony2 bundle lives at
[https://github.com/hautelook/TemplatedUriBundle](https://github.com/hautelook/TemplatedUriBundle).
[RFC-6570]: https://tools.ietf.org/html/rfc6570