PHPackages                             cleantalk/yii-antispam - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. cleantalk/yii-antispam

ActiveYii-extension[Security](/categories/security)

cleantalk/yii-antispam
======================

Anti-spam yii extension by CleanTalk with protection against spam bots and manual spam.

1.1.0(10y ago)161.4k4GPL-3.0PHPPHP &gt;=5.3.0

Since Jun 17Pushed 1mo ago4 watchersCompare

[ Source](https://github.com/CleanTalk/yii-antispam)[ Packagist](https://packagist.org/packages/cleantalk/yii-antispam)[ Docs](https://github.com/CleanTalk/yii-antispam)[ RSS](/packages/cleantalk-yii-antispam/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/277461dae0b19b5265232b43a9fcb2fde8c1ec5a9b63acc3704943c1c416a026/68747470733a2f2f7472617669732d63692e6f72672f436c65616e54616c6b2f7969692d616e74697370616d2e737667)](https://travis-ci.org/cleantalk/yii-antispam)

Yii-antispam
------------

[](#yii-antispam)

Anti-spam by CleanTalk extension with protection against spam bots and manual spam.

No Captcha, no questions, no counting animals, no puzzles, no math.

If you find this project useful, please consider starring ⭐ it on GitHub — it helps us grow and support development!

Requirements
------------

[](#requirements)

- Yii 1.1 or above
- CleanTalk account

### Websites that trust CleanTalk!

[](#websites-that-trust-cleantalk)

[![CleanTalk Anti-Spam Rating](https://camo.githubusercontent.com/843a75b91b5196d88d81383a0aad9cc9ecc14010dce1e8f15aa7016678998cca/68747470733a2f2f636c65616e74616c6b2e6f72672f7765627061636b2f696d672f636c65616e74616c6b5f726174696e672e706e67)](https://camo.githubusercontent.com/843a75b91b5196d88d81383a0aad9cc9ecc14010dce1e8f15aa7016678998cca/68747470733a2f2f636c65616e74616c6b2e6f72672f7765627061636b2f696d672f636c65616e74616c6b5f726174696e672e706e67)

\##Usage

1. Get access key on
2. Extract content from archive under protected/extensions/yii-antispam
3. Open your application configuration in protected/config/main.php and modify components section:

```
// application components
'components'=>array(
    ...
        'cleanTalk'=>array(
            'class'=>'ext.yii-antispam.CleanTalkApi',
            'apiKey'=>'*****',
        ),
    ...
),

```

4. Add validator in your model, for example ContactForm

```
class ContactForm extends CFormModel
{
    public $name;
    public $email;
    public $body;
    ...
    public function rules()
    {
        return array(
            ...
            array('body',
                    'ext.yii-antispam.CleanTalkValidator',
                    'check'=>'message', /* Check type message or user */
                    'emailAttribute'=>'email',
                    'nickNameAttribute'=>'name',
                    /*'on'=>'insert' if ActiveRecord using */),
            ...
        );
    }
    ...
}

```

5. In form view add special hidden element

```
