ngatngay / nette-form-captcha
Nette Form Captcha
dev-master
2021-10-31 05:58 UTC
Requires
- php: >=8.0
- gregwar/captcha: *
- nette/di: ^3.0
- nette/forms: ^3.1
This package is auto-updated.
Last update: 2024-09-29 06:08:59 UTC
README
Simple Captcha
Install
composer require ngatngay/nette-form-captcha:dev-master
Setup
Config
extensions:
captcha: NgatNgay\NetteFormCaptcha\DI\CaptchaExtension
captcha:
autoload: yes
type: question # or numeric
questions:
"Question 1?": "1"
"Question 2?": "2"
Form
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; }
Render
{control form}