Skip to content

Instantly share code, notes, and snippets.

@kachar
Last active January 1, 2016 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kachar/8073825 to your computer and use it in GitHub Desktop.
Save kachar/8073825 to your computer and use it in GitHub Desktop.
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'question-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
'question',
'answer_a',
'answer_b',
array(
'class'=>'CButtonColumn',
'template' => '{up} {down}',
'buttons' => array(
'up' => array(
'label' => 'Up',
'visible'=>'$row > 0',
),
'down' => array(
'label' => 'Down',
'visible'=>'$row+1 < '.$model->search()->getPagination()->pageSize,
),
)
),
),
)); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment