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