Skip to content

Commit

Permalink
yiisoft#386 Move create button outside of pjax container
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkart committed Feb 18, 2019
1 parent f546005 commit e40c139
Showing 1 changed file with 7 additions and 4 deletions.
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 e40c139

Please sign in to comment.