Download the PHP package softark/yii2-mb-captcha without Composer

On this page you can find all versions of the php package softark/yii2-mb-captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-mb-captcha

yii2-mb-captcha

Multibyte captcha widget for Yii framework 2.0.

日本語の README

Description

softark\mbcaptcha\Captcha is an extension to yii\captcha\Captcha.

While yii\captcha\Captcha renders a CAPTCHA image only with English alphabets, softark\mbcaptcha\Captcha can render it with multibyte characters ... Japanese Hirakana by default, but you may use any multibyte characters by providing the appropriate font.

Optionally softark\mbcaptcha\Captcha may render a link next to the CAPTCHA image which will enable you to toggle the CAPTCHA type from the multibyte character to English alphabet, and vice versa.

softark\mbcaptcha\Captcha must be used together with softark\mbcaptcha\CaptchaAction to provide its feature.

Requirements

Usage

  1. Add softark/yii2-mb-captcha in your project's composer.json, and let Composer configure your project.

  2. Use softark\mbcaptcha\Captcha in place of yii\captcha\Captcha in your view.

    Optionally you may want to include {link} token in your template.

  3. Use softark\mbcaptcha\CaptchaAction in place of yii\captcha\CaptchaAction in your controller.

Properties of softark\mbcaptcha\Captcha

softark\mbcaptcha\Captcha supports all the properties of yii\captcha\Captcha and the following ones. The items with *()** are the basic options that you may want to configure.

  1. *template ()** @var string

    The template for arranging the CAPTCHA widget. Defaults to '{image} {link} {input}'.

    This property is inherited from the parent and is extended to support the type toggling link tag. In this template, the tokens {image}, {link} and {input} will be replaced with the actual image tag, the type toggling link tag and the text input tag respectively.

    Note that {link} must be a sibling of {image} in the DOM tree, otherwise the toggling link won't work.

    You may omit {link} token if you don't want the type toggling link tag.

  2. *toggleLinkLabel ()** @var string

    The label of the type toggling link. Defaults to "かな/abc" ("Japanese Hirakana/lower-case alphabet").

    You may want to change this label when you use non-Japanese characters.

Properties of softark\mbcaptcha\CaptchaAction

softark\mbcaptcha\CaptchaAction supports all the properties of yii\captcha\CaptchaAction and the following additional ones. The items with *()** are the basic options that you may want to configure.

  1. *mbFontFile ()** @var string

    The font to be used for multibyte characters. Defaults to seto-mini.ttf.

    Note that the default font only supports standard ASCII and Japanese Hirakana and Katakana.

    You have to provide an appropriate font file if you want to render your choice of characters.

  2. *seeds ()** @var string

    The string used for generating the random word. Several characters randomly selected from this string will make up the captcha word.

    Defaults to a series of Japanese Hirakana characters: "あいうえおかきくけこがぎぐげごさしすせそざじずぜぞたちつてとだぢづでどなにぬねのはひふへほはひふへほはひふへほばびぶべぼぱぴぷぺぽまみむめもやゆよらりるれろわをん".

    You may set your own. Make sure that your mbFontFile can render all the characters in the seeds.

  3. mbMinLength @var integer

    The minimum length for randomly generated multibyte character word. Defaults to 5

  4. mbMaxLength @var integer

    The maximum length for randomly generated multibyte character word. Defaults to 5

  5. mbOffset @var integer

    The offset between characters. Defaults to 2. You can adjust this property in order to decrease or increase the readability of the multibyte character captcha.

  6. fixedAngle @var boolean

    Whether to render the multibyte character captcha image with a fixed angle. Defaults to false. You may want to set this to true if you have trouble rendering your font.

How to Customize

The following is a sample code that shows how to customize softark\mbcaptcha\Captcha and softark\mbcaptcha\CaptchaAction. It shows Chinese characters for the captcha.

In the view script:

And in the controller:

Note that the sample code assumes that you have placed your choice of font file in the 'fonts' sub-directory of your frontend application directory.

You have to be careful not to include the characters in seeds that are not supported by your font.

History

Acknowledgment

Many thanks to the author of the wonderful work of setofont.ttf. The default font "seto-mini.ttf" is a subset of setofont.ttf.


All versions of yii2-mb-captcha with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package softark/yii2-mb-captcha contains the following files

Loading the files please wait ....