mdmsoft / yii2-captcha
Captcha with math equation
Installs: 10 222
Dependents: 1
Suggesters: 0
Security: 0
Stars: 39
Watchers: 6
Forks: 8
Open Issues: 4
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0
This package is not auto-updated.
Last update: 2024-12-21 17:40:39 UTC
README
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist mdmsoft/yii2-captcha "~1.0"
or add
"mdmsoft/yii2-captcha": "~1.0"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply modify your controler, add or change methode actions()
:
public function actions() { return [ ... 'captcha' => [ 'class' => 'mdm\captcha\CaptchaAction', 'level' => 3, // avaliable level are 1,2,3 :D ], ]; }
In view
<?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [ 'template' => '<div class="row"><div class="col-lg-12">{image}</div><div class="col-lg-12">{input}</div></div>', ]) ?>