The CAPTCHA type now works

This commit is contained in:
Gregwar
2011-08-25 23:10:24 +02:00
parent 4e1892fc02
commit bb2f9b94b8
4 changed files with 132 additions and 2 deletions

View File

@ -11,6 +11,7 @@ use Symfony\Component\Form\Exception\FormException;
use Symfony\Component\HttpFoundation\Session;
use Gregwar\CaptchaBundle\Validator\CaptchaValidator;
use Gregwar\CaptchaBundle\Generator\CaptchaGenerator;
/**
* Captcha type
@ -37,7 +38,9 @@ class CaptchaType extends AbstractType
public function buildView(FormView $view, FormInterface $form)
{
$view->set('captcha_code', $this->generateCaptchaValue());
$generator = new CaptchaGenerator($this->generateCaptchaValue());
$view->set('captcha_code', $generator->getCode());
}
public function getParent(array $options)