mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-11 19:20:01 +08:00
@@ -102,8 +102,9 @@ 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,9 +112,8 @@ class Pjax extends Widget
|
|||||||
*/
|
*/
|
||||||
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
|
|||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user