Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2-giiant
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dmstr
yii2-giiant
Commits
2c98af20
Commit
2c98af20
authored
Oct 06, 2016
by
Fredy Nurman Saleh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix indent
parent
d94cc56c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
view.php
src/generators/crud/default/views/view.php
+7
-7
RelationProvider.php
src/generators/crud/providers/core/RelationProvider.php
+1
-1
No files found.
src/generators/crud/default/views/view.php
View file @
2c98af20
...
...
@@ -11,7 +11,7 @@ use yii\helpers\StringHelper;
/** @var \yii\db\ActiveRecord $model */
/** @var $generator \schmunk42\giiant\generators\crud\Generator */
## TODO: move to generator (?); cleanup
$model
=
new
$generator
->
modelClass
();
$model
=
new
$generator
->
modelClass
();
$model
->
setScenario
(
'crud'
);
$safeAttributes
=
$model
->
safeAttributes
();
if
(
empty
(
$safeAttributes
))
...
...
@@ -161,9 +161,9 @@ EOS;
if
(
$relation
->
via
!==
null
)
{
$pivotName
=
Inflector
::
pluralize
(
$generator
->
getModelByTableName
(
$relation
->
via
->
from
[
0
]));
$pivotName
=
Inflector
::
pluralize
(
$generator
->
getModelByTableName
(
$relation
->
via
->
from
[
0
]));
$pivotRelation
=
$model
->
{
'get'
.
$pivotName
}();
$pivotPk
=
key
(
$pivotRelation
->
link
);
$pivotPk
=
key
(
$pivotRelation
->
link
);
$addButton
=
" <?= Html::a(
'<span class=
\"
glyphicon glyphicon-link
\"
></span> ' . "
.
$generator
->
generateString
(
'Attach'
)
.
" . ' "
.
...
...
@@ -203,15 +203,15 @@ EOS;
// render pivot grid
if
(
$relation
->
via
!==
null
)
{
$pjaxId
=
"pjax-
{
$pivotName
}
"
;
$pjaxId
=
"pjax-
{
$pivotName
}
"
;
$gridRelation
=
$pivotRelation
;
$gridName
=
$pivotName
;
$gridName
=
$pivotName
;
}
else
{
$pjaxId
=
"pjax-
{
$name
}
"
;
$pjaxId
=
"pjax-
{
$name
}
"
;
$gridRelation
=
$relation
;
$gridName
=
$name
;
$gridName
=
$name
;
}
$output
=
$generator
->
relationGrid
(
$gridName
,
$gridRelation
,
$showAllRecords
);
...
...
src/generators/crud/providers/core/RelationProvider.php
View file @
2c98af20
...
...
@@ -324,7 +324,7 @@ EOS;
$pageParam
=
Inflector
::
slug
(
"page-
{
$name
}
"
);
$firstPageLabel
=
$this
->
generator
->
generateString
(
'First'
);
$lastPageLabel
=
$this
->
generator
->
generateString
(
'Last'
);
$code
=
"'<div class=
\"
table-responsive
\"
>'
\n
. "
;
$code
=
"'<div class=
\"
table-responsive
\"
>'
\n
. "
;
$code
.=
<<<EOS
\\yii\\grid\\GridView::widget([
'layout' => '{summary}{pager}<br/>{items}{pager}',
...
...
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