PHPackages                             developit/yii2-captcha - 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. developit/yii2-captcha

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

developit/yii2-captcha
======================

yii2 captcha

1.2(8y ago)919.1k↓50%2GPL-3.0PHP

Since Oct 1Pushed 8y ago2 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

yii2 captcha
============

[](#yii2-captcha)

yii2 captcha with Ability to recognize Arabic and Persian numbers.

[![screenshot](https://camo.githubusercontent.com/bcb9de43b929fd4616b498405fc507359a25004eac425990ffb37a86d7ebb0f5/687474703a2f2f7777772e646576656c6f7069742e69722f746d702f636170746368612e6a7067)](https://camo.githubusercontent.com/bcb9de43b929fd4616b498405fc507359a25004eac425990ffb37a86d7ebb0f5/687474703a2f2f7777772e646576656c6f7069742e69722f746d702f636170746368612e6a7067)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist developit/yii2-captcha "*"

```

or add

```
"developit/yii2-captcha": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply modify your controler, add or change methode `actions()`:

```
    public function actions()
    {
        $this->layout = $this->setting['layout'];
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
            'captcha' => [
                'class' => 'developit\captcha\CaptchaAction',
                'type' => 'numbers', // 'numbers', 'letters' or 'default' (contains numbers & letters)
                'minLength' => 4,
                'maxLength' => 4,
            ],
        ];
    }
```

In view

```
use developit\captcha\Captcha;
