2017 © Pedro Peláez
 

library php-enhanced-urlgenerator

Url Genarater for Silex enhanced by some features.

image

mtrunkat/php-enhanced-urlgenerator

Url Genarater for Silex enhanced by some features.

  • Wednesday, January 22, 2014
  • by mtrunkat
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

EnhancedUrlGenerator

This is Symfony Url Generator class enhanced by two features:, (*1)

  • It preserves given set of query parameters in every generated url.
  • It allows to generate random token for user transaction. This token is preserved in every url until the user leaves the site. It can be used for clicktracking or to track the users in simple access log.

It's boundled with Silex Service provider. It works exactly the same as the original Silex Url Generator Provider. To install Enhanced Url Generator add following line into your composer.json, (*2)

"mtrunkat/php-enhanced-urlgenerator": "dev-master"

and call update/install command of composer. Then register provider to Silex:, (*3)

$app->register(new \Trunkat\EnhancedUrlGeneratorProvider(), array(
    'url_generator.preserve' => array('key1', 'keyb'),
));

You can use it the same as original Silex Url Generator:, (*4)

$app['url_generator']->generate('blog', array('someParam' => 'someValue'));

Resulting url will contain "key1" and "key2" as query parameters. To activate the random token feature configure provider following way:, (*5)

$app->register(new \Trunkat\EnhancedUrlGeneratorProvider(), array(
    'url_generator.preserve' => array('key1', 'keyb'),
    'url_generator.token' => 'keyNameForToken',
    'url_generator.token_length' => 5,
));

The Versions

22/01 2014

dev-master

9999999-dev https://github.com/mtrunkat/php-enhanced-urlgenerator

Url Genarater for Silex enhanced by some features.

  Sources   Download

MIT

The Requires

 

The Development Requires