PHP code example of yiier / yii2-anti-spam

1. Go to this page and download the library: Download yiier/yii2-anti-spam library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yiier / yii2-anti-spam example snippets



use \yiier\antiSpam\models\Spam;

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


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

php composer.phar 

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