Adds an option to renew the code (fixes #43)

This commit is contained in:
Gregwar
2012-12-25 20:07:00 +01:00
parent 6b340eb258
commit 35405aca2e
6 changed files with 19 additions and 1 deletions

View File

@ -33,6 +33,10 @@ class GregwarCaptchaExtension extends Extension
$container->setParameter('gregwar_captcha.config.expiration', $config['expiration']);
$container->setParameter('gregwar_captcha.config.whitelist_key', $config['whitelist_key']);
if ($config['reload'] && !$config['as_url']) {
throw new \InvalidArgumentException('GregwarCaptcha: The reload option cannot be set without as_url, see the README for more information');
}
$resources = $container->getParameter('twig.form.resources');
$container->setParameter('twig.form.resources', array_merge(array('GregwarCaptchaBundle::captcha.html.twig'), $resources));
}