Commit 14064492 by Qiang Xue

Merge pull request #2534 from Alex-Code/pjax

Pjax container fix
parents 201de174 f7911bc9
...@@ -102,18 +102,18 @@ class Pjax extends Widget ...@@ -102,18 +102,18 @@ class Pjax extends Widget
if ($view->title !== null) { if ($view->title !== null) {
echo Html::tag('title', Html::encode($view->title)); echo Html::tag('title', Html::encode($view->title));
} }
} } else {
echo Html::beginTag('div', $this->options); echo Html::beginTag('div', $this->options);
} }
}
/** /**
* @inheritdoc * @inheritdoc
*/ */
public function run() public function run()
{ {
echo Html::endTag('div');
if (!$this->requiresPjax()) { if (!$this->requiresPjax()) {
echo Html::endTag('div');
$this->registerClientScript(); $this->registerClientScript();
return; return;
} }
...@@ -152,7 +152,7 @@ class Pjax extends Widget ...@@ -152,7 +152,7 @@ class Pjax extends Widget
protected function requiresPjax() protected function requiresPjax()
{ {
$headers = Yii::$app->getRequest()->getHeaders(); $headers = Yii::$app->getRequest()->getHeaders();
return $headers->get('X-Pjax') && ($selector = $headers->get('X-Pjax-Container')) === '#' . $this->getId(); return $headers->get('X-Pjax') && $headers->get('X-Pjax-Container') === '#' . $this->getId();
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment