micsay / yii2-captcha
yii2-captcha for restful api by returning image's base64 extend yii/captcha/CaptchaAction
Installs: 220
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 2
Open Issues: 1
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-02-02 02:32:30 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;