ezsystems/templated-uri-router

Symfony2 RFC-6570 compatible router and URL Generator

Package info

github.com/ezsystems/TemplatedUriRouter

Homepage

pkg:composer/ezsystems/templated-uri-router

Statistics

Installs: 8 294

Dependents: 1

Suggesters: 0

Stars: 1

3.3.0 2020-03-17 12:26 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

MIT a9133db2af212ace614326cc59b52ec40ac432e8

  • Baldur Rensch <brensch.woop@gmail.com>

jsonxmlSymfony2urlrouteruriHATEOASRFC 6570

This package is auto-updated.

Last update: 2026-06-18 01:57:08 UTC


README

Symfony2 UrlGenerator that provides a 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.

👁 Build Status

Installation

Run the following command (assuming you have composer.phar or composer binary installed), or require hautelook/templated-uri-router to your composer.json and run composer install:

$ composer require hautelook/templated-uri-router

Usage

# routing.yml
hautelook_demo_route:
 pattern: /demo
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.