dev-master
9999999-devSimple Math Captcha
BSD-3-Clause
The Requires
by Henk Reitsma
yii2 captcha math
Wallogit.com
2017 © Pedro Peláez
Simple Math Captcha
The preferred way to install this extension is through composer., (*1)
Either run, (*2)
php composer.phar require --prefer-dist hreitsma/yii2-simplemath-captcha "dev-master"
or add, (*3)
"hreitsma/yii2-simplemath-captcha": "dev-master"
to the require section of your composer.json file., (*4)
Once the extension is installed, simply modify your controler, add or change methode actions():, (*5)
public function actions()
{
return [
...
'captcha' => [
'class' => 'hr\captcha\CaptchaAction',
'operators' => ['+','-','*'],
'maxValue' => 10,
'fontSize' => 18,
],
];
}
In view, (*6)
=
$form->field($model, 'verifyCode')->widget(Captcha::className(), [
//'captchaAction' => 'site/captcha', // uncomment and change if your not in the default controller or a module
'template' => '
{image}
{input}
',
])->hint('Hint: click on the equation to refresh')
?>
In config/web.php, (*7)
'rules' => [
'site/captcha/<refresh:\d+>' => 'site/captcha',
'site/captcha/<v:\w+>' => 'site/captcha',
]
, (*8)
Simple Math Captcha
BSD-3-Clause
yii2 captcha math