Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
7d2d925d
Commit
7d2d925d
authored
Sep 24, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added SerialColumn to crud generated code.
parent
cd969509
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
index.php
framework/yii/gii/generators/crud/templates/views/index.php
+3
-3
SerialColumn.php
framework/yii/grid/SerialColumn.php
+2
-0
No files found.
framework/yii/gii/generators/crud/templates/views/index.php
View file @
7d2d925d
...
@@ -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
:
?>
...
...
framework/yii/grid/SerialColumn.php
View file @
7d2d925d
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment