jberall/yii2-statusbehavior
Composer 安装命令:
composer require jberall/yii2-statusbehavior
包简介
A behavior that set the status to 0 when the status_column is set to null. triggered on BaseActiveRecord::EVENT_BEFORE_INSERT and BaseActiveRecord::EVENT_BEFORE_UPDATE
README 文档
README
A behavior that set the status to 0 when the status_column is set to null. triggered on BaseActiveRecord::EVENT_BEFORE_INSERT and BaseActiveRecord::EVENT_BEFORE_UPDATE
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist jberall/yii2-statusbehavior "*"
or add
"jberall/yii2-statusbehavior": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
public function behaviors() { $behaviors = [ 'statusBehavior' => [ 'class' => \frontend\behaviors\StatusBehavior::className(), 'status_column' => 'status_id', ], ]; return ArrayHelper::merge(parent::behaviors(),$behaviors); }
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-04-27