定制 pheme/yii2-toggle-column 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pheme/yii2-toggle-column

最新稳定版本:0.8

Composer 安装命令:

composer require pheme/yii2-toggle-column

包简介

Provides a toggle data column and action

README 文档

README

Provides a toggle data column and action

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist pheme/yii2-toggle-column "*"

or add

"pheme/yii2-toggle-column": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

// In your Controller
use pheme\grid\actions\ToggleAction;

public function actions()
{
	return [
		'toggle' => [
			'class' => ToggleAction::className(),
			'modelClass' => 'path\to\your\Model',
			// Uncomment to enable flash messages
			//'setFlash' => true,
		]
	];
}

// In your view
use yii\grid\GridView;
use yii\widgets\Pjax;

Pjax::begin();

GridView::widget(
	[
		'dataProvider' => $dataProvider,
		'filterModel' => $searchModel,
		'columns' => [
			'id',
			[
				'class' => '\pheme\grid\ToggleColumn',
				'attribute' => 'active',
				// Uncomment if  you don't want AJAX
				// 'enableAjax' => false,
			],
			['class' => 'yii\grid\ActionColumn'],
		],
	]
);

Pjax::end();

统计信息

  • 总下载量: 748.48k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 27
  • 点击次数: 1
  • 依赖项目数: 13
  • 推荐数: 0

GitHub 信息

  • Stars: 23
  • Watchers: 6
  • Forks: 21
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-09-30