Yii 1.1: bad-words-filter

The component for replacement bad words on ***

The component for replacement bad words on ***. It's intended for forms, which can be can be filled by users. Base is complete for russian words especially, but you can complete personal base of words in BadWords.php.


Yii 1.1.x


1) In model rules()

"surname" and "name" - it's the names of properties in your model.

array('surname, name', 'filter', 'filter'=>array("BadWords", "replacement")),

2) Like a method

$name = Yii::app()->badWords->replacement($name);


1) Copy this file in /protected/components/

2) Add this component in /protected/config/main.php

        'badWords' => array(
            'class' => 'badWords'

Total 2 comments

#5847 report it
ardem at 2011/11/20 04:38am
Re: I have an error

Hi, bonnie.

Did you correctly completed all items from "Installation"?

#5844 report it
bonnie at 2011/11/19 06:41pm
I have an error

include(BadWords.php) [function.include]: failed to open stream: No such file or directory

Leave a comment

Please to leave your comment.

Create extension