2016-04-11 32 views
0

我在Yii框架中是全新的,我有一個小問題,我沒有找到任何東西。我用Pjax在主要佈局(我使用的是基本的應用程序),所以我把Yii Pjax navbar

Pjax::begin(); 

之前$內容,然後我在此之後關閉Pjax。 因此,結果是頁面中的每個鏈接都沒有重新加載頁面,但導航欄中的鏈接將其重新加載。我試圖把Pjax的開頭放在導航欄之前,但它不起作用。有人得到這個解決方案。在Pjax中有一部分網站是非常奇怪的。

謝謝:)

回答

0

請提供您的佈局代碼。沒有它就很難說出來。基本上,它應該是這樣的:

<?php 
use use app\assets\AppAsset; 
use yii\widgets\Pjax; 
?> 
<?php AppAsset::register($this); 
<?php $this->beginPage() ?> 
<?php $this->beginBody() ?> 
<? Pjax::begin(['id' => 'main', 'timeout' => 3000, 'scrollTo' => 0]); ?> 
<?= 'Your navbar here' ?> 
<?= $content ?> 
<? Pjax::end(); ?> 
<?php $this->endBody() ?> 
<?php $this->endPage() ?>