Skip to content

Instantly share code, notes, and snippets.

@tom--
Created May 19, 2013 23:33
Show Gist options
  • Save tom--/5609552 to your computer and use it in GitHub Desktop.
Save tom--/5609552 to your computer and use it in GitHub Desktop.
Row number in a Yii CGridView. The row number is that of the row in the data provider's overall data set.
<?php
/** @var CController $controller */
$controller->widget(
'zii.widgets.grid.CGridView',
array(
'columns' => array(
array(
'header' => 'Row',
'value' => '$row + ($this->grid->dataProvider->pagination->currentPage
* $this->grid->dataProvider->pagination->pageSize)',
),
)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment