2017 © Pedro Peláez
 

yii2-extension yii2-simplemath-captcha

Simple Math Captcha

image

hreitsma/yii2-simplemath-captcha

Simple Math Captcha

  • Tuesday, March 28, 2017
  • by hreitsma
  • Repository
  • 2 Watchers
  • 6 Stars
  • 1,352 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 18 % Grown

The README.md

Captcha With a Simple Math Equation

Installation

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)

Usage

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',
]

screenshot, (*8)

The Versions

28/03 2017

dev-master

9999999-dev

Simple Math Captcha

  Sources   Download

BSD-3-Clause

The Requires

 

by Henk Reitsma

yii2 captcha math