Skip to content

Commit

Permalink
Fixes #386: Move "Create" button outside of pjax container to avoid r…
Browse files Browse the repository at this point in the history
…edirect
  • Loading branch information
alexkart authored and samdark committed Feb 19, 2019
1 parent f546005 commit 7139eb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Yii Framework 2 gii extension Change Log
- Enh #390, Bug #260: Create (bootstrap)-independent version (simialbi)
- Enh #395: Made `yii\gii\CodeFile` independent of controller context, do not apply `$newDirMode` and `$newFileMode` if module is not available (CeBe)
- Enh #399: Option to allow singularize class names in model generator (alexkart)
- Bug #386: Move "Create" button outside of pjax container to avoid redirect (alexkart)


2.0.8 December 08, 2018
Expand Down
11 changes: 7 additions & 4 deletions src/generators/crud/default/views/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-index">

<h1><?= "<?= " ?>Html::encode($this->title) ?></h1>
<?= $generator->enablePjax ? " <?php Pjax::begin(); ?>\n" : '' ?>
<?php if(!empty($generator->searchModelClass)): ?>
<?= " <?php " . ($generator->indexWidgetType === 'grid' ? "// " : "") ?>echo $this->render('_search', ['model' => $searchModel]); ?>
<?php endif; ?>

<p>
<?= "<?= " ?>Html::a(<?= $generator->generateString('Create ' . Inflector::camel2words(StringHelper::basename($generator->modelClass))) ?>, ['create'], ['class' => 'btn btn-success']) ?>
</p>

<?= $generator->enablePjax ? " <?php Pjax::begin(); ?>\n" : '' ?>
<?php if(!empty($generator->searchModelClass)): ?>
<?= " <?php " . ($generator->indexWidgetType === 'grid' ? "// " : "") ?>echo $this->render('_search', ['model' => $searchModel]); ?>
<?php endif; ?>

<?php if ($generator->indexWidgetType === 'grid'): ?>
<?= "<?= " ?>GridView::widget([
'dataProvider' => $dataProvider,
Expand Down Expand Up @@ -75,5 +76,7 @@
},
]) ?>
<?php endif; ?>

<?= $generator->enablePjax ? " <?php Pjax::end(); ?>\n" : '' ?>

</div>

0 comments on commit 7139eb8

Please sign in to comment.