xepan / captcha
ATK filestore modified for xEpan Platform
1.0.0
2016-10-07 10:35 UTC
Requires
- php: >=5.3
- xepan/atk4: 4.3
This package is not auto-updated.
Last update: 2025-01-04 21:41:46 UTC
README
captcha plugin for atk4
$form = $this->add('Form');
$form->addField('Line','captcha')->add('x_captcha/Controller_Captcha');
$form->addSubmit('Check');
$form->onSubmit(function($form){
if ($form->getElement('captcha')->captcha->isSame($form->get('captcha'))) {
$form->js()->univ()->successMessage('Captcha is OK!')->execute();
} else {
$form->js()->atk4_form('fieldError','captcha','Wrong captcha!')->execute();
}
});
If you need case unsensetive captcha just pass false as a second argument for method isSame
if ($form->getElement('captcha')->captcha->isSame($form->get('captcha',false)))