本文整理汇总了PHP中yii\widgets\Pjax类的典型用法代码示例。如果您正苦于以下问题:PHP Pjax类的具体用法?PHP Pjax怎么用?PHP Pjax使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Pjax类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$this->registerScripts();
if ($this->type == self::TYPE_INDEX) {
Pjax::begin(['enablePushState' => false, 'enableReplaceState' => false, 'linkSelector' => '.pagination a']);
}
echo Html::tag('div', '', ['class' => 'ajax-crud-container ajax-crud-type-' . $this->type . ' ajax-crud-name-' . $this->name, 'id' => $this->getContainerId(), 'data' => ['type' => $this->type, 'name' => $this->name, 'container-index' => '#' . $this->getContainerId(self::TYPE_INDEX), 'container-create' => '#' . $this->getContainerId(self::TYPE_CREATE), 'container-update' => '#' . $this->getContainerId(self::TYPE_UPDATE)]]);
if ($this->type == self::TYPE_INDEX) {
Pjax::end();
}
}
示例2: getPjaxEnd
protected function getPjaxEnd()
{
$html = '';
if ($this->pjax) {
ob_start();
Pjax::end();
$html = ob_get_clean();
}
return $html;
}
示例3:
<?php
use anli\user\widgets\TenantList;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\Pjax;
$this->title = 'Tenant';
Pjax::begin(['id' => 'list-pjax']);
?>
<div class="row">
<div class="col-md-12">
<?php
echo TenantList::widget(['title' => "{$status} Tenants", 'subtitle' => 'showing up to 100...', 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>
</div>
</div>
<?php
pjax::end();
示例4:
/**
* @var PageForm $model
* @var array $seoAttributes
*/
use understeam\seotoolbar\assets\ToolbarAssets;
use understeam\seotoolbar\models\PageForm;
use yii\widgets\ActiveForm;
ToolbarAssets::register($this);
?>
<div class="seo-toolbar">
<div class="toolbar-inner collapsed">
<a class="yii-seo-toolbar-logo" href="#">
<span>></span>
</a>
<?php
$pjax = \yii\widgets\Pjax::begin(['id' => 'seo-toolbar-pjax', 'enablePushState' => false, 'linkSelector' => false, 'formSelector' => '#seo-entity-form']);
?>
<?php
$flashes = Yii::$app->session->getFlash('seo-success', [], true);
?>
<?php
foreach ($flashes as $flash) {
?>
<div class="seo-success">
<?php
echo $flash;
?>
</div>
<?php
}
?>
示例5: show_params
function show_params($id, $product)
{
?>
<?php
echo "<td><a href=\"../product?id=" . $product[$id]['product_id'] . "\">" . $product[$id]['name'] . "</a>" . "</td>";
?>
<?php
echo "<td>" . $product[$id]['quantity'] . "</td>";
?>
<?php
echo "<td>\$" . $product[$id]['price'] . "</td>";
?>
<?php
echo "<td>\$" . $product[$id]['quantity'] * $product[$id]['price'] . "</td>";
?>
<?php
Pjax::begin();
?>
<td><?php
echo Html::a("Delete", ['../product/del?id=' . $product[$id]['product_id']], ['class' => 'btn btn-sm btn-danger', 'type' => 'button']);
?>
</td>
<?php
Pjax::end();
?>
<?php
}
示例6: run
public function run(){
if($this->is_pjax){
Pjax::begin($this->pjaxOptions);
}
parent::run();
if($this->isShowForm) {
echo PageSize::widget([
'model' => $this->filterModel,
'attribute' => $this->attribute,
'options' => [
'data-pjax' => '0',
],
]);
}
if($this->is_pjax){
Pjax::end();
}
echo ModelCrud::widget([
'size' => $this->modalSize,
'updateUrl' => ($this->updateUrl)? $this->updateUrl : Url::to(['update']),
'createUrl' => ($this->createUrl)? $this->createUrl : Url::to(['create']),
'updateVerb' => 'post',
'viewUrl' => Url::to(['view']),
'viewVerb' => 'post',
'createVerb' => 'post',
'modelTitle' => $this->modelTitle,
'template' => '{view}{update}{create}',
'modelClass' => $this->dataProvider->query->modelClass
]);
}
示例7: _endPjax
/**
* @return $this
*/
protected function _endPjax()
{
if ($this->_pjaxIsStart === true) {
$className = $this->pjax->className();
$className::end();
}
return $this;
}
示例8: run
/**
* @inheritdoc
*/
public function run()
{
if ($this->requiresPjax()) {
echo Notify::widget($this->notifyOptions);
}
$id = $this->options['id'];
if ($this->modal) {
$this->getView()->registerJs("Admin.Modal.pjax('#{$id}');");
}
parent::run();
}
示例9: run
public function run()
{
if ($this->requiresPjax()) {
Alert::widget();
/// We do render breadcrumbs only for the main outer PJAX block
if ($this->id === Yii::$app->params['pjax']['id']) {
$this->addBreadcrumbs();
}
}
parent::run();
}
示例10: registerClientScript
/**
* Registers the needed JavaScript.
*/
public function registerClientScript()
{
parent::registerClientScript();
if ($this->blockPjaxContainer === true) {
$this->getView()->registerJs(<<<JS
(function(sx, \$, _)
{
var blockerPanel = new sx.classes.Blocker('.sx-panel');
\$(document).on('pjax:send', function(e)
{
var blockerPanel = new sx.classes.Blocker(\$(e.target));
blockerPanel.block();
})
\$(document).on('pjax:complete', function(e) {
blockerPanel.unblock();
})
})(sx, sx.\$, sx._);
JS
);
}
if ($this->blockContainer) {
$this->getView()->registerJs(<<<JS
(function(sx, \$, _)
{
var blockerPanel = new sx.classes.Blocker(\$("{$this->blockContainer}"));
\$(document).on('pjax:send', function(e)
{
var blockerPanel = new sx.classes.Blocker(\$("{$this->blockContainer}"));
blockerPanel.block();
})
\$(document).on('pjax:complete', function(e) {
blockerPanel.unblock();
})
})(sx, sx.\$, sx._);
JS
);
}
}
示例11: run
public function run()
{
Pjax::begin(['enablePushState' => false, 'formSelector' => $this->getFormId()]);
if (\Yii::$app->session->getFlash('yii2-params-updated')) {
// TODO: review this custom alert code
$closeButton = Html::button('×', ['data-dismiss' => 'alert', 'aria-hidden' => 'true', 'class' => 'close']);
echo Html::tag('div', $closeButton . "Params updated successfully!", ['class' => 'alert-info alert fade in']);
}
/** @var \zarv1k\params\models\DynamicParam[] $models */
$models = \zarv1k\params\models\Params::getDynamicModels();
$form = ActiveForm::begin(['id' => $this->getFormId(), 'action' => \Yii::$app->getUrlManager()->createUrl("{$this->_moduleId}/manage")]);
/** @var ActiveField $activeField */
$activeField = \Yii::$container->get('yii\\widgets\\ActiveField');
// TODO: review get from di
foreach ($models as $model) {
echo $form->field($model, "[{$model->owner->id}]{$model->owner->code}", ['labelOptions' => ArrayHelper::merge($activeField->labelOptions, ['label' => $model->owner->description, 'title' => $model->owner->name]), 'inputOptions' => ArrayHelper::merge($activeField->inputOptions, ['placeholder' => $model->owner->description, 'title' => $model->owner->name])]);
}
echo Html::submitButton($this->getSubmitContent(), $this->getSubmitOptions());
ActiveForm::end();
Pjax::end();
}
示例12: run
public function run()
{
$id = Html::getInputId($this->model, $this->attribute);
$name = Html::getInputName($this->model, $this->attribute);
Pjax::begin(['id' => $id, 'enablePushState' => false]);
if ($this->model->{$this->attribute}) {
echo $this->renderAddrobj($this->model->{$this->attribute});
echo $this->renderChildren($this->model->{$this->attribute});
// Выводит в скрытый инпут полное наименование для дальнейшего использования в гугл картах
echo Html::hiddenInput(null, FiasHelper::toFullString($this->model->{$this->attribute}), ['class' => 'full-name']);
} else {
// Выводит в скрытый инпут полное наименование для дальнейшего использования в гугл картах
echo Html::hiddenInput(null, null, ['class' => 'full-name']);
$query = FiasAddrobj::find();
$query->andWhere(['parentguid' => 'f6e148a1-c9d0-4141-a608-93e3bd95e6c4', 'currstatus' => 0]);
$query->orderBy('formalname');
$data = ArrayHelper::map($query->all(), 'aoguid', 'name');
echo $this->renderDropDownList($data);
}
echo Html::activeHiddenInput($this->model, $this->attribute, ['id' => null]);
$this->view->registerJs("\n\n \$('#" . $id . " select').change(function(){\n \n \$.pjax.defaults.data = {\n '{$name}': \$(this).val(),\n };\n\n \$.pjax.reload('#" . $id . "', {\n type: 'POST'\n });\n\n });\n ");
Pjax::end();
}
示例13: function
]);
// echo
// GridView::widget([
// 'dataProvider' => $dataProvider,
// 'filterModel' => $searchModel,
// 'columns' => [
// ['class' => 'yii\grid\SerialColumn'],
//// 'id',
// 'name',
// 'product_group_id',
// 'code',
// 'detail:ntext',
// // 'created_time',
// // 'last_update',
// // 'user_id',
// // 'product_unit_id',
// ['class' => 'yii\grid\ActionColumn'],
// ],
// ]);
?>
<?php Pjax::end() ?>
</div>
</div>
<?php
$this->registerJs('
$("#txtProductGroupId").on("input", function() {
var id = $(this).val().trim();
queryItem(id, "product-category/search", "productgroup-product_category_id", "txtProductGroupName");
});
');
示例14:
if (Mimin::filterRoute($this->context->id . '/tabarsip')) {
?>
<li class="active">
<a href="<?php
echo Url::to(['simpel-keg/varsip']);
?>
" >
Arsip </a>
</li>
<?php
}
?>
</ul>
</div>
<?php
Pjax::begin(['id' => 'dinasSearch']);
$url_search = Url::to(['simpel-keg/search-serasi']);
$js = <<<js
\$("#searchQuery").keyup(function(){
var kata = \$(this).val();
if(kata.length > 3 || kata.length == 0){
\$("#datadinasGridview").load("{$url_search}"+"?search="+\$(this).val());
}
});
js;
$this->registerJS($js);
?>
<div class="wp-posts-index">
示例15: function
['attribute'=>'fechacreacion_ft','format'=>['datetime',(isset(Yii::$app->modules['datecontrol']['displaySettings']['datetime'])) ? Yii::$app->modules['datecontrol']['displaySettings']['datetime'] : 'd-m-Y H:i:s A']],
[
'class' => 'yii\grid\ActionColumn',
'buttons' => [
'update' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', Yii::$app->urlManager->createUrl(['solicitud/view','id' => $model->id,'edit'=>'t']), [
'title' => Yii::t('yii', 'Edit'),
]);}
],
],
],
'responsive'=>true,
'hover'=>true,
'condensed'=>true,
'floatHeader'=>true,
'panel' => [
'heading'=>'<h3 class="panel-title"><i class="glyphicon glyphicon-th-list"></i> '.Html::encode($this->title).' </h3>',
'type'=>'info',
'before'=>Html::a('<i class="glyphicon glyphicon-plus"></i> Add', ['create'], ['class' => 'btn btn-success']), 'after'=>Html::a('<i class="glyphicon glyphicon-repeat"></i> Reset List', ['index'], ['class' => 'btn btn-info']),
'showFooter'=>false
],
]); Pjax::end(); ?>
</div>