dev-master
9999999-devBad word filter for Yii2
MIT
The Requires
extension yii2 bad word filter
Bad word filter for Yii2
Bad word filter for Yii2, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist idealia/yii2-bad-word "*"
or add, (*4)
"idealia/yii2-bad-word": "*"
to the require section of your composer.json
file., (*5)
Apply migrations, (*6)
php yii migrate --migrationPath=@vendor/idealia/yii2-bad-word/migrations
Add to config file, (*7)
'components' => [ 'badword' => [ 'class' => \idealia\badword\BadWord::class, // 'obfuscation' => true, 'provider' => [ 'class' => \idealia\badword\BadWordDbProvider::class ] ], ]
$foo = Yii::$app->badword->filter('your text with bad words to replace by ***');
In active record validator, (*8)
public function rules() { return [ ['title', BadWordFilter::class], ] }
Bad word filter for Yii2
MIT
extension yii2 bad word filter