Added "length" option and changed the parameters names
This commit is contained in:
@ -17,14 +17,11 @@ class Configuration implements ConfigurationInterface
|
||||
$rootNode = $treeBuilder->root('gregwar_captcha', 'array');
|
||||
|
||||
$rootNode
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->arrayNode('image')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->scalarNode('width')->defaultValue(120)->end()
|
||||
->scalarNode('height')->defaultValue(40)->end()
|
||||
->end()
|
||||
->end()
|
||||
->scalarNode('length')->defaultValue(5)->end()
|
||||
->scalarNode('width')->defaultValue(120)->end()
|
||||
->scalarNode('height')->defaultValue(40)->end()
|
||||
->end()
|
||||
;
|
||||
return $treeBuilder;
|
||||
|
@ -19,8 +19,10 @@ class GregwarCaptchaExtension extends Extension
|
||||
$configuration = new Configuration();
|
||||
$config = $this->processConfiguration($configuration, $configs);
|
||||
|
||||
$container->setParameter('gregwar_captcha.image.height', $config['image']['height']);
|
||||
$container->setParameter('gregwar_captcha.image.width', $config['image']['width']);
|
||||
$container->setParameter('gregwar_captcha.length', $config['length']);
|
||||
$container->setParameter('gregwar_captcha.height', $config['height']);
|
||||
$container->setParameter('gregwar_captcha.width', $config['width']);
|
||||
|
||||
$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