PHPackages                             lubosdz/yii2-captcha-extended - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lubosdz/yii2-captcha-extended

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

lubosdz/yii2-captcha-extended
=============================

Extended captcha code generator for Yii2 framework with configurable obfuscation level

1.0.5(2y ago)1117.4k↓10.9%1BSD-3-ClausePHPPHP &gt;=7.0

Since Mar 30Pushed 2y ago2 watchersCompare

[ Source](https://github.com/lubosdz/yii2-captcha-extended)[ Packagist](https://packagist.org/packages/lubosdz/yii2-captcha-extended)[ RSS](/packages/lubosdz-yii2-captcha-extended/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (0)

Yii2 Captcha Extended
=====================

[](#yii2-captcha-extended)

[Yii2 Captcha Extended](https://github.com/lubosdz/yii2-captcha-extended) is an extension written for Yii2 framework. It enhances original captcha code delivered along with the framework - see [DEMO](https://synet.sk/blog/php/260-yii-framework-demos). Version for Yii 1.x is available at [Yii Framework Extensions](https://www.yiiframework.com/extension/captcha-extended).

Features
========

[](#features)

- supports modes: default, math, mathverbal, words, logical
- supports extended characters latin1, latin2 (utf-8) including middle- east- european and cyrillyc characters
- adds visual obfuscation elements: dots density, through lines, fillSections, random text &amp; background color
- mode-dependent options: randomUpperLowerCase (default mode), resultMultiplier (math mode)

[![Screenshot](https://camo.githubusercontent.com/ccea0dead4b43e5c4d4796ed420e0fc64237fa6a7efe99298de951e902429a1d/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e64656453686f742e706e67)](https://camo.githubusercontent.com/ccea0dead4b43e5c4d4796ed420e0fc64237fa6a7efe99298de951e902429a1d/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e64656453686f742e706e67)[![Screenshot](https://camo.githubusercontent.com/aa43500056778e379c16f063ee289a48f762d8f31aa6d3cf51d6f17948493d40/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e64656453686f742d736b2e706e67)](https://camo.githubusercontent.com/aa43500056778e379c16f063ee289a48f762d8f31aa6d3cf51d6f17948493d40/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e64656453686f742d736b2e706e67)
[![Screenshot](https://camo.githubusercontent.com/fab1f6ed828217d8c218ec5d8a0af8299712af6187e9256d9f7840a016ae1fda/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e64656453686f742d64652e706e67)](https://camo.githubusercontent.com/fab1f6ed828217d8c218ec5d8a0af8299712af6187e9256d9f7840a016ae1fda/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e64656453686f742d64652e706e67)[![Screenshot](https://camo.githubusercontent.com/58063251f899280c85a44aa902a7352df383ee88948a4e2b80e2ea3626d9f40a/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e6465642d6c6f676963616c2e676966)](https://camo.githubusercontent.com/58063251f899280c85a44aa902a7352df383ee88948a4e2b80e2ea3626d9f40a/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e6465642d6c6f676963616c2e676966)
[![Screenshot](https://camo.githubusercontent.com/f9991cfc3dc608e498f3672c00bfac38749087ab0101722f72b506ea52bda034/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e6465642d6d61746876657262616c2e676966)](https://camo.githubusercontent.com/f9991cfc3dc608e498f3672c00bfac38749087ab0101722f72b506ea52bda034/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e6465642d6d61746876657262616c2e676966)
[![Screenshot](https://camo.githubusercontent.com/033a2ec3542ba3b962205ee48d277b9c68817772163ec0ef2a140655094f4025/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e6465642d6d6174682e676966)](https://camo.githubusercontent.com/033a2ec3542ba3b962205ee48d277b9c68817772163ec0ef2a140655094f4025/687474703a2f2f7374617469632e73796e65742e736b2f63617074636861457874656e6465642d6d6174682e676966)

INSTALLATION
============

[](#installation)

1. Install via composer:

```
$ composer require "lubosdz/yii2-captcha-extended" : "~1.0.0"
```

or you can include the following in your composer.json file:

```
{
	"require": {
		"lubosdz/yii2-captcha-extended" : "~1.0.0"
	}
}
```

2. Define action in controller, e.g. `SiteController`:

```
public function actions()
{
	return [
		'captcha' => [
			'class' => 'lubosdz\captchaExtended\CaptchaExtendedAction',
			// optionally, set mode and obfuscation properties e.g.:
			'mode' => 'math',
			//'mode' => CaptchaExtendedAction::MODE_MATH,
			//'resultMultiplier' => 5,
			//'lines' => 5,
			//'density' => 10,
			//'height' => 50,
			//'width' => 150,
		],
	];
}
```

3. Define client validation in `LoginForm::rules()`:

```
public $verifyCode;

public function rules()
{
	return [
		['verifyCode', 'lubosdz\captchaExtended\CaptchaExtendedValidator',
			'captchaAction' => Url::to('/site/captcha'),
		],
	];
}
```

4. In view defined captcha field inside login form e.g.:

```

// ...
