1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace yii\grid;
- class SerialColumn extends Column
- {
-
- public $header = '#';
-
- protected function renderDataCellContent($model, $key, $index)
- {
- $pagination = $this->grid->dataProvider->getPagination();
- if ($pagination !== false) {
- return $pagination->getOffset() + $index + 1;
- }
- return $index + 1;
- }
- }
|