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 f9db0bf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 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

0 comments on commit f9db0bf

Please sign in to comment.