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
3e23f7ad
Commit
3e23f7ad
authored
Mar 16, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2771 from lucianobaraglia/gii-psr2
GII generated files changes according to PSR2
parents
dbc6d106
7c75b9bc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
24 deletions
+24
-24
controller.php
extensions/gii/generators/crud/templates/controller.php
+4
-4
search.php
extensions/gii/generators/crud/templates/search.php
+3
-3
_form.php
extensions/gii/generators/crud/templates/views/_form.php
+4
-4
_search.php
extensions/gii/generators/crud/templates/views/_search.php
+6
-6
index.php
extensions/gii/generators/crud/templates/views/index.php
+4
-4
view.php
extensions/gii/generators/crud/templates/views/view.php
+2
-2
model.php
extensions/gii/generators/model/templates/model.php
+1
-1
No files found.
extensions/gii/generators/crud/templates/controller.php
View file @
3e23f7ad
...
...
@@ -70,7 +70,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
/**
* Displays a single
<?=
$modelClass
?>
model.
*
<?=
implode
(
"
\n
\t
* "
,
$actionParamComments
)
.
"
\n
"
?>
*
<?=
implode
(
"
\n
* "
,
$actionParamComments
)
.
"
\n
"
?>
* @return mixed
*/
public function actionView(
<?=
$actionParams
?>
)
...
...
@@ -101,7 +101,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
/**
* Updates an existing
<?=
$modelClass
?>
model.
* If update is successful, the browser will be redirected to the 'view' page.
*
<?=
implode
(
"
\n
\t
* "
,
$actionParamComments
)
.
"
\n
"
?>
*
<?=
implode
(
"
\n
* "
,
$actionParamComments
)
.
"
\n
"
?>
* @return mixed
*/
public function actionUpdate(
<?=
$actionParams
?>
)
...
...
@@ -120,7 +120,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
/**
* Deletes an existing
<?=
$modelClass
?>
model.
* If deletion is successful, the browser will be redirected to the 'index' page.
*
<?=
implode
(
"
\n
\t
* "
,
$actionParamComments
)
.
"
\n
"
?>
*
<?=
implode
(
"
\n
* "
,
$actionParamComments
)
.
"
\n
"
?>
* @return mixed
*/
public function actionDelete(
<?=
$actionParams
?>
)
...
...
@@ -133,7 +133,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
/**
* Finds the
<?=
$modelClass
?>
model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
*
<?=
implode
(
"
\n
\t
* "
,
$actionParamComments
)
.
"
\n
"
?>
*
<?=
implode
(
"
\n
* "
,
$actionParamComments
)
.
"
\n
"
?>
* @return
<?=
$modelClass
?>
the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
...
...
extensions/gii/generators/crud/templates/search.php
View file @
3e23f7ad
...
...
@@ -33,12 +33,12 @@ use <?= ltrim($generator->modelClass, '\\') . (isset($modelAlias) ? " as $modelA
*/
class
<?=
$searchModelClass
?>
extends Model
{
public $
<?=
implode
(
";
\n
\t
public $"
,
$searchAttributes
)
?>
;
public $
<?=
implode
(
";
\n
public $"
,
$searchAttributes
)
?>
;
public function rules()
{
return [
<?=
implode
(
",
\n
\t\t\t
"
,
$rules
)
?>
,
<?=
implode
(
",
\n
"
,
$rules
)
?>
,
];
}
...
...
@@ -65,7 +65,7 @@ class <?= $searchModelClass ?> extends Model
return $dataProvider;
}
<?=
implode
(
"
\n
\t\t
"
,
$searchConditions
)
?>
<?=
implode
(
"
\n
"
,
$searchConditions
)
?>
return $dataProvider;
}
...
...
extensions/gii/generators/crud/templates/views/_form.php
View file @
3e23f7ad
...
...
@@ -33,11 +33,11 @@ use yii\widgets\ActiveForm;
<?=
"<?php "
?>
$form = ActiveForm::begin(); ?>
<?php
foreach
(
$safeAttributes
as
$attribute
)
{
echo
"
\t\t
<?= "
.
$generator
->
generateActiveField
(
$attribute
)
.
" ?>
\n\n
"
;
echo
"
<?= "
.
$generator
->
generateActiveField
(
$attribute
)
.
" ?>
\n\n
"
;
}
?>
<div
class=
"form-group"
>
<?=
"<?= "
?>
Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<div
class=
"form-group"
>
<?=
"<?= "
?>
Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?=
"<?php "
?>
ActiveForm::end(); ?>
...
...
extensions/gii/generators/crud/templates/views/_search.php
View file @
3e23f7ad
...
...
@@ -32,16 +32,16 @@ use yii\widgets\ActiveForm;
$count
=
0
;
foreach
(
$generator
->
getColumnNames
()
as
$attribute
)
{
if
(
++
$count
<
6
)
{
echo
"
\t\t
<?= "
.
$generator
->
generateActiveSearchField
(
$attribute
)
.
" ?>
\n\n
"
;
echo
"
<?= "
.
$generator
->
generateActiveSearchField
(
$attribute
)
.
" ?>
\n\n
"
;
}
else
{
echo
"
\t\t
<?php // echo "
.
$generator
->
generateActiveSearchField
(
$attribute
)
.
" ?>
\n\n
"
;
echo
"
<?php // echo "
.
$generator
->
generateActiveSearchField
(
$attribute
)
.
" ?>
\n\n
"
;
}
}
?>
<div
class=
"form-group"
>
<?=
"<?= "
?>
Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?=
"<?= "
?>
Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div>
<div
class=
"form-group"
>
<?=
"<?= "
?>
Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?=
"<?= "
?>
Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div>
<?=
"<?php "
?>
ActiveForm::end(); ?>
...
...
extensions/gii/generators/crud/templates/views/index.php
View file @
3e23f7ad
...
...
@@ -48,18 +48,18 @@ $count = 0;
if
((
$tableSchema
=
$generator
->
getTableSchema
())
===
false
)
{
foreach
(
$generator
->
getColumnNames
()
as
$name
)
{
if
(
++
$count
<
6
)
{
echo
"
\t\t\t
'"
.
$name
.
"',
\n
"
;
echo
"
'"
.
$name
.
"',
\n
"
;
}
else
{
echo
"
\t\t\t
// '"
.
$name
.
"',
\n
"
;
echo
"
// '"
.
$name
.
"',
\n
"
;
}
}
}
else
{
foreach
(
$tableSchema
->
columns
as
$column
)
{
$format
=
$generator
->
generateColumnFormat
(
$column
);
if
(
++
$count
<
6
)
{
echo
"
\t\t\t
'"
.
$column
->
name
.
(
$format
===
'text'
?
""
:
":"
.
$format
)
.
"',
\n
"
;
echo
"
'"
.
$column
->
name
.
(
$format
===
'text'
?
""
:
":"
.
$format
)
.
"',
\n
"
;
}
else
{
echo
"
\t\t\t
// '"
.
$column
->
name
.
(
$format
===
'text'
?
""
:
":"
.
$format
)
.
"',
\n
"
;
echo
"
// '"
.
$column
->
name
.
(
$format
===
'text'
?
""
:
":"
.
$format
)
.
"',
\n
"
;
}
}
}
...
...
extensions/gii/generators/crud/templates/views/view.php
View file @
3e23f7ad
...
...
@@ -46,12 +46,12 @@ $this->params['breadcrumbs'][] = $this->title;
<?php
if
((
$tableSchema
=
$generator
->
getTableSchema
())
===
false
)
{
foreach
(
$generator
->
getColumnNames
()
as
$name
)
{
echo
"
\t\t\t
'"
.
$name
.
"',
\n
"
;
echo
"
'"
.
$name
.
"',
\n
"
;
}
}
else
{
foreach
(
$generator
->
getTableSchema
()
->
columns
as
$column
)
{
$format
=
$generator
->
generateColumnFormat
(
$column
);
echo
"
\t\t\t
'"
.
$column
->
name
.
(
$format
===
'text'
?
""
:
":"
.
$format
)
.
"',
\n
"
;
echo
"
'"
.
$column
->
name
.
(
$format
===
'text'
?
""
:
":"
.
$format
)
.
"',
\n
"
;
}
}
?>
...
...
extensions/gii/generators/model/templates/model.php
View file @
3e23f7ad
...
...
@@ -45,7 +45,7 @@ class <?= $className ?> extends <?= '\\' . ltrim($generator->baseClass, '\\') .
*/
public function rules()
{
return [
<?=
"
\n
\t\t\t
"
.
implode
(
",
\n\t\t\t
"
,
$rules
)
.
"
\n\t\t
"
?>
];
return [
<?=
"
\n
"
.
implode
(
",
\n
"
,
$rules
)
.
"
\n
"
?>
];
}
/**
...
...
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