Browse Source

Added SerialColumn to crud generated code.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
7d2d925dbe
  1. 6
      framework/yii/gii/generators/crud/templates/views/index.php
  2. 2
      framework/yii/grid/SerialColumn.php

6
framework/yii/gii/generators/crud/templates/views/index.php

@ -43,6 +43,8 @@ $this->params['breadcrumbs'][] = $this->title;
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => array(
array('class' => 'yii\grid\SerialColumn'),
<?php
$count = 0;
foreach ($generator->getTableSchema()->columns as $column) {
@ -55,9 +57,7 @@ foreach ($generator->getTableSchema()->columns as $column) {
}
?>
array(
'class' => 'yii\grid\ActionColumn',
),
array('class' => 'yii\grid\ActionColumn'),
),
)); ?>
<?php else: ?>

2
framework/yii/grid/SerialColumn.php

@ -15,6 +15,8 @@ namespace yii\grid;
*/
class SerialColumn extends Column
{
public $header = '#';
/**
* Renders the data cell content.
* @param mixed $model the data model

Loading…
Cancel
Save