0
我有這樣的代碼在佈局/ main.php文件:如何更新頁面的其他部分(使用PJAX)?
<div class="wrap">
<? \yii\widgets\Pjax::begin(['id' => 'nav_pjax'])?>
<?php
NavBar::begin([
'brandLabel' => 'Название компании',
'brandUrl' => Yii::$app->homeUrl,
'options' => [
'id' => 'ww',
'class' => 'navbar-inverse navbar-relative',
],
]);
echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right', 'id' => 'ww'],
'items' => User::getMenuItemsByRoleUser(!Yii::$app->user->isGuest ? Yii::$app->user : false,Yii::$app->user->isGuest)
]);
NavBar::end();
?>
<? \yii\widgets\Pjax::end()?>
<div class="container" id="content_inner">
<? \yii\widgets\Pjax::begin(['timeout' => '3000'])?>
<?= Breadcrumbs::widget([
'homeLink'=>[
'label' => 'Главная', // required
'url' => \yii\helpers\Url::home(), // optional, will be processed by Url::to()
],
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
<?= $content ?>
<? \yii\widgets\Pjax::end()?>
</div>
當我點擊進入導航欄鏈接,服務器返回的內容,我想投入DIV CLASS =「容器」 ID = 「content_inner」。我該怎麼做?或者我應該完全刷新頁面?