Делаю страницу с выводом action через Pjax.
Все чудесно, кроме того, что рисует 2 дебаг панели...
Не критично, конечно. На продакшене дебаг отключится, но все же интересно...
Может быть не так вывожу?
Контроллер:
public function actionAbc($letter)
{
$letter = Yii::$app->request->get('letter');
$designers = Designer::getDesignerAbc($letter);
return $this->render('index', [
'designers' => $this->renderAjax('/designer/abc', compact('designers', 'letter')),
]);
}
Представление:
<?php
/**
* Created by PhpStorm.
* User: alexandr
* Date: 25.12.17
* Time: 20:23
*/
//use Yii;
use yii\helpers\Url;
?>
<div class="designer-abc col-md-12 animated bounceInDown">
<h2><?= $letter ?></h2>
<?php if (empty($designers)): ?>
<p>There is no one designer. Please try another letter.</p>
<?php else: ?>
<?php foreach ($designers as $designer): ?>
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 designer-item">
<?php $img = $designer->getImage(); ?>
<h2>
<?= $designer->brand_name ?>
</h2>
<div class="row">
<?= $designer->description ?>
<a href="<?= Url::toRoute(['designer/view', 'id' => $designer->id]); ?>">View more</a>
<img src="<?= $img->getUrl('x400') ?>" alt="">
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php
/**
* Created by PhpStorm.
* User: alexandr
* Date: 25.12.17
* Time: 20:07
*/
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\helpers\Url;
use yii\widgets\Pjax;
$this->title = Yii::$app->name . ' | Designers';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="designer-index col-md-12 animated bounceInLeft">
<h1>
Designers
</h1>
<div class="col-md-12">
<?php Pjax::begin(['enablePushState' => false]); ?>
<?php echo Nav::widget([
'id' => 'designer-nav',
'encodeLabels' => false,
'items' => [
['label' => 'A', 'url' => ['designer/abc', 'letter' => 'A']],
['label' => 'B', 'url' => ['designer/abc', 'letter' => 'B']],
['label' => 'C', 'url' => ['designer/abc', 'letter' => 'C']],
['label' => 'D', 'url' => ['designer/abc', 'letter' => 'D']],
['label' => 'E', 'url' => ['designer/abc', 'letter' => 'E']],
['label' => 'F', 'url' => ['designer/abc', 'letter' => 'F']],
['label' => 'G', 'url' => ['designer/abc', 'letter' => 'G']],
['label' => 'H', 'url' => ['designer/abc', 'letter' => 'H']],
['label' => 'I', 'url' => ['designer/abc', 'letter' => 'I']],
['label' => 'J', 'url' => ['designer/abc', 'letter' => 'J']],
['label' => 'K', 'url' => ['designer/abc', 'letter' => 'K']],
['label' => 'L', 'url' => ['designer/abc', 'letter' => 'L']],
['label' => 'M', 'url' => ['designer/abc', 'letter' => 'M']],
['label' => 'N', 'url' => ['designer/abc', 'letter' => 'N']],
['label' => 'O', 'url' => ['designer/abc', 'letter' => 'O']],
['label' => 'P', 'url' => ['designer/abc', 'letter' => 'P']],
['label' => 'Q', 'url' => ['designer/abc', 'letter' => 'Q']],
['label' => 'R', 'url' => ['designer/abc', 'letter' => 'R']],
['label' => 'S', 'url' => ['designer/abc', 'letter' => 'S']],
['label' => 'T', 'url' => ['designer/abc', 'letter' => 'T']],
['label' => 'U', 'url' => ['designer/abc', 'letter' => 'U']],
['label' => 'V', 'url' => ['designer/abc', 'letter' => 'V']],
['label' => 'W', 'url' => ['designer/abc', 'letter' => 'W']],
['label' => 'X', 'url' => ['designer/abc', 'letter' => 'X']],
['label' => 'Y', 'url' => ['designer/abc', 'letter' => 'Y']],
['label' => 'Z', 'url' => ['designer/abc', 'letter' => 'Z']],
],
'options' => ['class' => 'abc-nav'],
]); ?>
<?= $designers; ?>
<?php Pjax::end(); ?>
<!-- Pjax end -->
</div>
</div>