https://github.com/cleantalk/yii-antispam
Anit-spam extension for Yii framework.
https://github.com/cleantalk/yii-antispam
anti-spam antispam php spam-filtering spam-protection yii-antispam yii-extension
Last synced: 7 months ago
JSON representation
Anit-spam extension for Yii framework.
- Host: GitHub
- URL: https://github.com/cleantalk/yii-antispam
- Owner: CleanTalk
- Created: 2014-05-23T09:05:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-10-04T11:35:50.000Z (about 1 year ago)
- Last Synced: 2025-03-17T14:13:10.404Z (7 months ago)
- Topics: anti-spam, antispam, php, spam-filtering, spam-protection, yii-antispam, yii-extension
- Language: PHP
- Size: 24.4 KB
- Stars: 15
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
##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.
[](https://travis-ci.org/cleantalk/yii-antispam)
## Requirements
* Yii 1.1 or above
* CleanTalk account https://cleantalk.org/register?product=anti-spam##Usage
1) Get access key on https://cleantalk.org/register?platform=yii
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
~~~
beginWidget('CActiveForm', array(
...
cleanTalk->checkJsHiddenField()?>
...
...
endWidget(); ?>~~~
##License
GNU General Public License##Resources
* https://cleantalk.org/
* https://github.com/CleanTalk/yii-antispam