micsay/yii2-captcha

yii2-captcha for restful api by returning image's base64 extend yii/captcha/CaptchaAction

Installs: 216

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 2

Open Issues: 1

Type:yii2-extension

1.1 2016-11-08 12:47 UTC

This package is not auto-updated.

Last update: 2024-04-13 23:00:35 UTC


README

###installation php composer.phar require micsay/yii2-captcha ~1.1 ###Usage

use micsay\captcha\CaptchaBuilder;
\\...

public function actionCaptcha(){
    $captcha = new CaptchaBuilder();
    $verifycode = $captcha->getPharse();
    $base64 = $captcha->base64();
    return $base64;
}

###API

    $captcha = new CaptchaBuilder();
    $captcha->minLength = 4;
    $captcha->maxLength = 5;
    $captcha->foreColor = 0x00ff00;
    $captcha->width = 80;
    $captcha->height = 45;