Commit 7d2d925d by Qiang Xue

Added SerialColumn to crud generated code.

parent cd969509
...@@ -43,6 +43,8 @@ $this->params['breadcrumbs'][] = $this->title; ...@@ -43,6 +43,8 @@ $this->params['breadcrumbs'][] = $this->title;
'dataProvider' => $dataProvider, 'dataProvider' => $dataProvider,
'filterModel' => $searchModel, 'filterModel' => $searchModel,
'columns' => array( 'columns' => array(
array('class' => 'yii\grid\SerialColumn'),
<?php <?php
$count = 0; $count = 0;
foreach ($generator->getTableSchema()->columns as $column) { foreach ($generator->getTableSchema()->columns as $column) {
...@@ -55,9 +57,7 @@ foreach ($generator->getTableSchema()->columns as $column) { ...@@ -55,9 +57,7 @@ foreach ($generator->getTableSchema()->columns as $column) {
} }
?> ?>
array( array('class' => 'yii\grid\ActionColumn'),
'class' => 'yii\grid\ActionColumn',
),
), ),
)); ?> )); ?>
<?php else: ?> <?php else: ?>
......
...@@ -15,6 +15,8 @@ namespace yii\grid; ...@@ -15,6 +15,8 @@ namespace yii\grid;
*/ */
class SerialColumn extends Column class SerialColumn extends Column
{ {
public $header = '#';
/** /**
* Renders the data cell content. * Renders the data cell content.
* @param mixed $model the data model * @param mixed $model the data model
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment