Add key parameter to URL generation method.
This commit is contained in:
@ -15,7 +15,7 @@ class Configuration implements ConfigurationInterface
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder();
|
||||
$rootNode = $treeBuilder->root('gregwar_captcha', 'array');
|
||||
$rootNode = $treeBuilder->root('gregwar_captcha');
|
||||
|
||||
$rootNode
|
||||
->addDefaultsIfNotSet()
|
||||
@ -28,7 +28,6 @@ class Configuration implements ConfigurationInterface
|
||||
->scalarNode('charset')->defaultValue('abcdefhjkmnprstuvwxyz23456789')->end()
|
||||
->scalarNode('as_file')->defaultValue(false)->end()
|
||||
->scalarNode('as_url')->defaultValue(false)->end()
|
||||
->scalarNode('url')->defaultValue('/generate-captcha')->end()
|
||||
->scalarNode('image_folder')->defaultValue('captcha')->end()
|
||||
->scalarNode('web_path')->defaultValue('%kernel.root_dir%/../web')->end()
|
||||
->scalarNode('gc_freq')->defaultValue(100)->end()
|
||||
@ -36,8 +35,10 @@ class Configuration implements ConfigurationInterface
|
||||
->scalarNode('quality')->defaultValue(15)->end()
|
||||
->scalarNode('invalid_message')->defaultValue('Bad code value')->end()
|
||||
->scalarNode('bypass_code')->defaultValue(null)->end()
|
||||
->arrayNode('valid_keys')->defaultValue(array('captcha'))->prototype('scalar')->end()
|
||||
->end()
|
||||
;
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ class GregwarCaptchaExtension extends Extension
|
||||
$container->setParameter('gregwar_captcha.config.web_path', $config['web_path']);
|
||||
$container->setParameter('gregwar_captcha.config.gc_freq', $config['gc_freq']);
|
||||
$container->setParameter('gregwar_captcha.config.expiration', $config['expiration']);
|
||||
$container->setParameter('gregwar_captcha.config.url', $config['url']);
|
||||
|
||||
$resources = $container->getParameter('twig.form.resources');
|
||||
$container->setParameter('twig.form.resources', array_merge(array('GregwarCaptchaBundle::captcha.html.twig'), $resources));
|
||||
|
Reference in New Issue
Block a user