本文整理汇总了PHP中yii\widgets\Pjax::widget方法的典型用法代码示例。如果您正苦于以下问题:PHP Pjax::widget方法的具体用法?PHP Pjax::widget怎么用?PHP Pjax::widget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\widgets\Pjax
的用法示例。
在下文中一共展示了Pjax::widget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
use yii\widgets\Pjax;
use yii\bootstrap\Modal;
Modal::begin(['size' => 'modal-sm text-center', 'header' => '<h5>' . Yii::t('app', 'Do you want to delete the ad?') . '</h5>', 'toggleButton' => false, 'closeButton' => false, 'id' => 'delete-element-' . $widget->id]);
echo Html::button(Yii::t('app', 'Yes'), ['class' => 'btn btn-danger', 'style' => 'margin-right: 5px;', 'onclick' => '
$("#delete-element-' . $widget->id . '").modal("hide");
$.pjax({
type: "POST",
url: "' . Url::to(['/ad/view/delete']) . '",
container: "#element_container_' . $widget->id . '",
data: {id: ' . $widget->id . '},
push: false
})
']);
echo Html::button(Yii::t('app', 'No'), ['class' => 'btn btn-success', 'data-dismiss' => 'modal', 'aria-hidden' => 'true', 'style' => 'margin-left: 5px;']);
Modal::end();
Pjax::widget();
$js = <<<JS
\$("#star_container_{$widget->id}").on("pjax:complete", function() {
\$("#star_container_{$widget->id}").attr("tabindex",-1).focus();
});
JS;
$this->registerJS($js);
?>
<div id="element_container_<?php
echo $widget->id;
?>
" class="main-container-element <?php
echo $widget->main_container_class;
?>
">