yaqbick/yii2-purifier-behavior
最新稳定版本:v1.0.0
Composer 安装命令:
composer require yaqbick/yii2-purifier-behavior
包简介
Purifier provides an ability to clean up HTML from any harmful code.
README 文档
README
Purifier provides an ability to clean up HTML from any harmful code.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist rokorolov/yii2-purifier-behavior "*"
or add
"rokorolov/yii2-purifier-behavior": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
Attach a behavior to model and configure.
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'] ] ], ]; }
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2022-12-14