I use symfony 1.4.8 . I add ReCaptcha to my form , using SfExtraFormPlugin. I have widget and validator for it in my ” public function configure() “
....
$this->widgetSchema['captcha'] = new sfWidgetFormReCaptcha(array(
'public_key' => sfConfig::get('app_recaptcha_public_key')
));
$this->validatorSchema['captcha'] = new sfValidatorReCaptcha(array(
'private_key' => sfConfig::get('app_recaptcha_private_key')
));
...
I also have backend app , and my “public function configure()” for it :
public function configure()
{
parent::configure();
....
}
So when I want to add post from my backend I have an error:The item has not been saved due to some errors.
Is there a way to remove widget and validators for ReCaptcha only to my backend? Now I see only one way, it is to remove
parent::configure();
and write all widget and validators to backend separately from the frontend widget and validators.. 🙁
p.s Sorry for my bad English
p.p.s Thank you in advance for your answers 😉
Add an option to your form. When you instantiate it, you should know if you’re on the backend or the frontend.
It should work 🙂