yiier/yii2-anti-spam

反垃圾

Installs: 200

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

v0.2 2019-06-24 08:38 UTC

This package is auto-updated.

Last update: 2024-12-24 21:12:49 UTC


README

反垃圾评论

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yiier/yii2-anti-spam "*"

or add

"yiier/yii2-anti-spam": "*"

to the require section of your composer.json file.

Migrations

Run the following command

php yii migrate --migrationPath=@yiier/antiSpam/migrations/

Usage

Create Spam:

<?php
use \yiier\antiSpam\models\Spam;

Spam::create(Spam::TYPE_CONTAINS, '网{2}赌');
Spam::create(Spam::TYPE_CONTAINS, '找小姐');
Spam::create(Spam::TYPE_SIMILAR, '网赌平台冻账号说我违规套利不给出款该怎么办?');

Spam Validator :

public function rules()
{
    return [
        // ... 
        ['content', \yiier\antiSpam\SpamValidator::className()],
        // code
    ];
}