ezsystems/templated-uri-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony2 Bundle that provides a RFC-6570 compatible router and URL Generator.

Package info

github.com/ezsystems/TemplatedUriBundle

Homepage

Type:symfony-bundle

pkg:composer/ezsystems/templated-uri-bundle

Statistics

Installs: 12 166

Dependents: 0

Suggesters: 0

Stars: 1

3.4.0 2020-03-16 14:19 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

MIT 6e122ba68bd0c8ec810f99feefd569006bbf9f5e

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

jsonxmlSymfony2urluriHATEOASRFC 6570

This package is auto-updated.

Last update: 2022-05-23 03:35:19 UTC


README

Symfony Bundle for the https://github.com/hautelook/TemplatedUriRouter library. hautelook/TemplatedUriRouter provides a RFC-6570 compatible Symfony router and URL Generator.

👁 Build Status
👁 SensioLabsInsight

Installation

Assuming you have installed composer, run the following command:

$ composer require hautelook/templated-uri-bundle

Now add the bundle to your Kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
 $bundles = array(
 // ...
 new Hautelook\TemplatedUriBundle\HautelookTemplatedUriBundle(),
 // ...
 );
}

If you are using Symfony Flex, this bundle is added automatically to your bundles.php file.

Usage

The bundle exposes a router service (hautelook.router.template) that will generate RFC-6570 compliant URLs. Here is a sample on how you could use it:

$templateLink = $container->get('hautelook.router.template')->generate('hautelook_demo_route',
 array(
 'page' => '{page}',
 'sort' => array('{sort}'),
 'filter' => array('{filter}'),
 )
);

This will produce a link similar to:

/demo?{&page}{&sort*}{&filter*}