Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngatngay/nette-form-captcha
https://github.com/ngatngay/nette-form-captcha
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ngatngay/nette-form-captcha
- Owner: ngatngay
- Created: 2021-10-31T01:53:52.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-31T05:58:05.000Z (over 3 years ago)
- Last Synced: 2024-12-21T11:38:30.454Z (about 1 month ago)
- Language: PHP
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nette Form Captcha
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
```php
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}
```## Example
![image](https://raw.githubusercontent.com/ngatngay/nette-form-captcha/master/screenshot.png)
![image](https://raw.githubusercontent.com/ngatngay/nette-form-captcha/master/screenshot2.png)