dev-master
9999999-dev https://github.com/mtrunkat/php-enhanced-urlgeneratorUrl Genarater for Silex enhanced by some features.
MIT
The Requires
- php >=5.3.0
- symfony/routing 2.*
- symfony/http-foundation 2.*
The Development Requires
Wallogit.com
2017 © Pedro Peláez
Url Genarater for Silex enhanced by some features.
This is Symfony Url Generator class enhanced by two features:, (*1)
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,
));
Url Genarater for Silex enhanced by some features.
MIT