Skip to content

Instantly share code, notes, and snippets.

@tiagocardosos
Forked from davialexandre/gist:3921652
Created October 20, 2012 01:56
Show Gist options
  • Save tiagocardosos/3921672 to your computer and use it in GitHub Desktop.
Save tiagocardosos/3921672 to your computer and use it in GitHub Desktop.
Exemplo de customização de filtros no CGridView
<?php $this->widget('zii.widgets.grid.CGridView', array(
'columns'=>array(
array(
'name' => 'pesquisa',
'value' => '$data->pesquisa',
'header' => 'Termo',
),
array(
'name' => 'data_cadastro',
'value' => 'Yii::app()->dateFormatter->formatDatetime(strtotime($data->data_cadastro), "short", "short")',
'filter' => CHtml::activeTextField($pesquisa, 'data_cadastro'),
),
array(
'name' => 'id_status',
'value' => '$data->status->status',
'filter' => CHtml::activeDropDownList($pesquisa, 'id_status', CHtml::listData($status, 'id', 'status'), array('prompt'=>'')),
),
),
)); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment