isavon/yii2-quickstatus
最新稳定版本:1.0
Composer 安装命令:
composer require isavon/yii2-quickstatus
包简介
The Quickstatus extension for the Yii2 Framework
README 文档
README
yii2-quickstatus
Installation
The preferred way to install this extension is through composer.
To install, either run
$ php composer.phar require isavon/yii2-quickstatus "@dev"
or add
"isavon/yii2-quickstatus": "@dev"
to the require section of your composer.json file.
Changes
NOTE: Refer the CHANGE LOG for details on changes to various releases.
Usage
Add QuickStatusAction to your controller.
public function actions() { return [ 'active' => [ 'class' => QuickStatusAction::className(), 'modelName' => Model::className(), ], 'hidden' => [ 'class' => QuickStatusAction::className(), 'modelName' => Model::className() ] ]; }
Add QuickStatusBehavior to your model.
public function behaviors() { return [ [ 'class' => QuickStatusBehavior::className(), ] ]; }
And add isavon\grid\ActionColumn with {active} {hidden} template to GriwView widget in your view file.
<?= GridView::widget([ 'dataProvider' => $dataProvider, 'columns' => [ 'id', 'title', [ 'class' => 'isavon\grid\ActionColumn', 'template' => '{active} {hidden} {update} {delete}', 'visibleButtons' => [ 'hidden' => function ($model) { return $model->status !== $model->statusHidden; }, 'active' => function ($model) { return $model->status !== $model->statusActive; } ], ] ] ]) ?>
Done!
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-11