library captcha
ATK filestore modified for xEpan Platform
xepan/captcha
ATK filestore modified for xEpan Platform
- Friday, October 7, 2016
- by gowrav
- Repository
- 2 Watchers
- 0 Stars
- 2,236 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 3 Forks
- 0 Open issues
- 2 Versions
- 37 % Grown
x_captcha
captcha plugin for atk4, (*1)
$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, (*2)
if ($form->getElement('captcha')->captcha->isSame($form->get('captcha',false)))
, (*3)