我在Yii框架公司是个新手,我有个小问题,什么都没发现。我在主布局中使用Pjax (我使用的是基本应用程序),所以我将
Pjax::begin();在$content之前,然后在此之后关闭Pjax。因此,结果是页面中的每个链接都没有重新加载页面,而是重新加载导航栏中的链接。我试着把Pjax的开头放在肚脐之前,但是它没有起作用。有人想办法解决这个问题。只是Pjax网站的一部分是很奇怪的。
谢谢:)
发布于 2016-04-12 07:16:40
请提供您的布局代码。没有它是很难说的。基本上,它应该是这样的:
<?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() ?>https://stackoverflow.com/questions/36545524
复制相似问题