Skip to content

haohetao/yii2-rest-api-captcha

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2-rest-api-captcha

Simple captcha image generator for restful api 22

Installation

Recommended installation via composer:

composer require haohetao/yii2-rest-api-captcha

Usage

Generate captcha code (image/png;base64):

    public function actions()
    {
        return [
            'captcha' => [
                'class' => 'haohetao\captcha\CaptchaAction',
                'maxLength' => 4,
                'minLength' => 4
            ]
        ];
    }

use in curl(for test):

curl http://localhost/site/captcha

Verify captcha code:

    public function rules()
    {
        return [
            [
                'code', \haohetao\captcha\CaptchaValidator::class
            ]
        ];
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%