macgyer/yii2-spamshield

Mathematical captcha for Yii2

1.1.0 2019-01-03 08:21 UTC

This package is auto-updated.

Last update: 2024-04-29 03:51:16 UTC


README

Installation

The preferred way of installation is through Composer. If you don't have Composer you can get it here: https://getcomposer.org/

You must be able to load NPM assets via Composer. This can either be achieved by the FXP composer asset plugin or by using Asset Packagist.

To install the package add the following to the require section of your composer.json:

"require": {
    "macgyer/yii2-spamshield": "*"
},

Usage

// in your ActiveForm

<?= $form->field($model, 'yourProperty')->widget(\macgyer\yii2spamshield\SpamShield::class) ?>

Please check the source for details on how to configure the widget instance.

// in your Model

public function rules()
{
    return [
        // other rules
        ['yourProperty', \macgyer\yii2spamshield\SpamShieldValidator::class]
    ];
}

Changelog

1.0.0 - 2019-01-02

  • initial release