getParameter('captcha_ref'); if($captcha != $session_captcha) { //sfContext::getInstance()->getUser()->setAttribute('captcha', NULL); $error = $this->getParameter('captcha_error'); return false; } return true; } public function initialize ($context, $parameters = null) { // Initialize parent parent::initialize($context); // Set default parameters value $this->setParameter('captcha_ref', $context->getUser()->getAttribute('captcha')); $this->setParameter('captcha_error', 'Неверный код'); // Set parameters $this->getParameterHolder()->add($parameters); return true; } } ?>