PHP code example of yaqbick / yii2-purifier-behavior
1. Go to this page and download the library: Download yaqbick/yii2-purifier-behavior 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/ */
yaqbick / yii2-purifier-behavior example snippets
use rokorolov\purifier\PurifierBehavior;
public function behaviors()
{
return [
// ...
'purifierBehavior' => [
'class' => PurifierBehavior::className(),
'attributes' => [
self::EVENT_BEFORE_UPDATE => ['description'],
self::EVENT_BEFORE_INSERT => ['description'],
],
'textAttributes' => [
self::EVENT_BEFORE_UPDATE => ['title', 'slug'],
self::EVENT_BEFORE_INSERT => ['title', 'slug']
]
],
];
}
php composer.phar