Simple Captcha
composer require ngatngay/nette-form-captcha:dev-master
Config
extensions:
captcha: NgatNgay\NetteFormCaptcha\DI\CaptchaExtension
captcha:
autoload: yes
type: question # or numeric
questions:
"Question 1?": "1"
"Question 2?": "2"
use Nette\Application\UI\Form;
public function createComponentForm()
{
$form = new Form();
$form->addCaptcha('captcha', 'Are you robot?');
$form->addSubmit('send');
$form->onSuccess[] = function (Form $form) {
dump($form['captcha']);
};
return $form;
}
{control form}