Visualcpatchark
Features
Visual Captcha RK
It uses emotionloop/visualcaptcha, (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist rklandesverband/yii2-visualcaptchark "*"
or add, (*4)
"rklandesverband/yii2-visualcaptchark": "*"
to the require section of your composer.json
file., (*5)
Usage
Once the extension is installed, simply use it in your code by :, (*6)
php
<?php
use rklandesverband\visualcaptchark\Captchark;
?>
<?php echo Captchark::widget(); ?>
, (*7)
Add a Controller, (*8)
```php
<?php
use rklandesverband\visualcaptchark\Sessioncaptcha;
use yii\helpers\Url;
use yii\web\Controller;
use yii\helpers\Json;
use Yii;, (*9)
class VisualcaptchaController extends Controller
{, (*10)
public function actionStart($howmany = 5)
{
$captcha = new Captchark();
return $captcha->start($howmany);
}
public function actionImage($index)
{
$captcha = new Captchark();
return $captcha->image($index);
}
public function actionAudio()
{
$captcha = new Captchark();
return $captcha->audio();
}
public function actionCaptcha(){
$captcha = new Captchark();
return $captcha->checkVisualCaptcha();
}
}, (*11)
```, (*12)
In the main.php add rules
```php
'passwort/visualcaptcha/start/howmany:\d+' => 'passwort/visualcaptcha/start',
'passwort/visualcaptcha/image/index:\d+' => 'passwort/visualcaptcha/image',
'passwort/visualcaptcha/audio/' => 'passwort/visualcaptcha/audio',
'passwort/visualcaptcha/captcha' => 'passwort/visualcaptcha/captcha',
'passwort/passwort/visualcaptcha/start/howmany:\d+' => 'passwort/visualcaptcha/start',
'passwort/passwort/visualcaptcha/image/index:\d+' => 'passwort/visualcaptcha/image',
'passwort/passwort/visualcaptcha/audio/' => 'passwort/visualcaptcha/audio',
'passwort/passwort/visualcaptcha/captcha' => 'passwort/visualcaptcha/captcha',, (*13)
```
yii2-visualcaptchark
Visualcpatchark LV NOE, (*14)