urmaul/yii-selectcolumn

SelectColumn for Yii CGridView.

v1.0.1 2014-11-19 16:59 UTC

This package is not auto-updated.

Last update: 2024-11-09 17:03:45 UTC


README

SelectColumn for Yii CGridView. It replaces cell content with label from map. And it sets that map as dropdown filter.

Installing

composer require urmaul/yii-selectcolumn dev-master

Using

First, add this line to imports config:

'import'=>array(
	...
	'SelectColumn',
	...
),

Using with enum attributes

Works great with EnumAttributes behavior.

array(
	'class' => 'SelectColumn',
	'name' => 'status',
	'labels' => $model->statusEnum->valueLabels,
),

Using with relations

Works great with ListData behavior.

array(
	'class' => 'SelectColumn',
	'name' => 'category_id',
	'labels' => Category::model()->listData,
),