Commit 2c98af20 authored by Fredy Nurman Saleh's avatar Fredy Nurman Saleh

fix indent

parent d94cc56c
...@@ -11,7 +11,7 @@ use yii\helpers\StringHelper; ...@@ -11,7 +11,7 @@ use yii\helpers\StringHelper;
/** @var \yii\db\ActiveRecord $model */ /** @var \yii\db\ActiveRecord $model */
/** @var $generator \schmunk42\giiant\generators\crud\Generator */ /** @var $generator \schmunk42\giiant\generators\crud\Generator */
## TODO: move to generator (?); cleanup ## TODO: move to generator (?); cleanup
$model = new $generator->modelClass(); $model = new $generator->modelClass();
$model->setScenario('crud'); $model->setScenario('crud');
$safeAttributes = $model->safeAttributes(); $safeAttributes = $model->safeAttributes();
if (empty($safeAttributes)) if (empty($safeAttributes))
...@@ -161,9 +161,9 @@ EOS; ...@@ -161,9 +161,9 @@ EOS;
if ($relation->via !== null) 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}(); $pivotRelation = $model->{'get'.$pivotName}();
$pivotPk = key($pivotRelation->link); $pivotPk = key($pivotRelation->link);
$addButton = " <?= Html::a( $addButton = " <?= Html::a(
'<span class=\"glyphicon glyphicon-link\"></span> ' . ".$generator->generateString('Attach')." . ' ". '<span class=\"glyphicon glyphicon-link\"></span> ' . ".$generator->generateString('Attach')." . ' ".
...@@ -203,15 +203,15 @@ EOS; ...@@ -203,15 +203,15 @@ EOS;
// render pivot grid // render pivot grid
if ($relation->via !== null) if ($relation->via !== null)
{ {
$pjaxId = "pjax-{$pivotName}"; $pjaxId = "pjax-{$pivotName}";
$gridRelation = $pivotRelation; $gridRelation = $pivotRelation;
$gridName = $pivotName; $gridName = $pivotName;
} }
else else
{ {
$pjaxId = "pjax-{$name}"; $pjaxId = "pjax-{$name}";
$gridRelation = $relation; $gridRelation = $relation;
$gridName = $name; $gridName = $name;
} }
$output = $generator->relationGrid($gridName, $gridRelation, $showAllRecords); $output = $generator->relationGrid($gridName, $gridRelation, $showAllRecords);
......
...@@ -324,7 +324,7 @@ EOS; ...@@ -324,7 +324,7 @@ EOS;
$pageParam = Inflector::slug("page-{$name}"); $pageParam = Inflector::slug("page-{$name}");
$firstPageLabel = $this->generator->generateString('First'); $firstPageLabel = $this->generator->generateString('First');
$lastPageLabel = $this->generator->generateString('Last'); $lastPageLabel = $this->generator->generateString('Last');
$code = "'<div class=\"table-responsive\">'\n . "; $code = "'<div class=\"table-responsive\">'\n . ";
$code .= <<<EOS $code .= <<<EOS
\\yii\\grid\\GridView::widget([ \\yii\\grid\\GridView::widget([
'layout' => '{summary}{pager}<br/>{items}{pager}', 'layout' => '{summary}{pager}<br/>{items}{pager}',
......
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