php yii-widgets-Pjax类(方法)实例源码

下面列出了php yii-widgets-Pjax 类(方法)源码代码实例,从而了解它的用法。

作者:omniligh    项目:yz2-admi   
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();
     }
 }

作者:lukianovv    项目:clove   
protected function getPjaxEnd()
 {
     $html = '';
     if ($this->pjax) {
         ob_start();
         Pjax::end();
         $html = ob_get_clean();
     }
     return $html;
 }

作者:simbiosis-grou    项目:yii2-use   
<?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();

作者:heartshar    项目:yii2-seo-toolba   
/**
 * @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>&gt;</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 
}
?>

作者:night1p    项目:Nzi_Projec   
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 
}

作者:harish-reglobb    项目:Auctio   
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
        ]);
    }

作者:skeeks-cm    项目:cm   
/**
  * @return $this
  */
 protected function _endPjax()
 {
     if ($this->_pjaxIsStart === true) {
         $className = $this->pjax->className();
         $className::end();
     }
     return $this;
 }

作者:skor    项目:yii2-admin-templat   
/**
  * @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();
 }

作者:hiqde    项目:hipanel-cor   
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();
 }

作者:Liv102    项目:cm   
/**
     * 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
);
        }
    }

作者:zarv1    项目:yii2-param   
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('&times;', ['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();
 }

作者:eje    项目:yii2-fia   
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();
 }

作者:adsavi    项目:ca   
]);
//        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");
    });
    ');

作者:ilhammali    项目:yii2-advanced-bet   
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">

作者:rzamarrip    项目:shabe   
['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>

作者:baranov-n    项目:setye   
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;
?>
">

作者:elguj    项目:yii2-dynamic-field   
/**
     * @inheritdoc
     */
    public function run()
    {
        $form = clone $this->form;
        if (empty($form->fieldConfig['template'])) {
            $form->fieldConfig['template'] = "{label}\n{input}\n{hint}\n{error}";
        }
        if (empty($form->fieldConfig['labelOptions'])) {
            $form->fieldConfig['labelOptions'] = ['class' => 'control-label'];
        }
        $keys = array_keys($this->models);
        $form->fieldConfig['template'] = str_replace('{input}', $this->inputTemplate, $form->fieldConfig['template']);
        $button = Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-plus']), $this->urlAdd, $this->buttonOptions);
        echo $this->field($form, $this->models[$keys[0]], "[{$keys[0]}]{$this->attribute}", $button);
        if (!$this->labelEach) {
            $form->fieldConfig['template'] = str_replace('{label}', Html::tag('label', '', $form->fieldConfig['labelOptions']), $form->fieldConfig['template']);
        }
        if (!$this->hintEach) {
            $form->fieldConfig['template'] = preg_replace('/\\{hint\\}|\\{hint\\}\\n|\\{hint\\}\\s/i', '', $form->fieldConfig['template']);
        }
        for ($i = 1; $i != count($keys); $i++) {
            $button = Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-minus']), array_merge((array) $this->urlRemove, ['id' => $this->models[$i]->{$this->primaryKey}]), $this->buttonOptions);
            echo $this->field($form, $this->models[$keys[$i]], "[{$keys[$i]}]{$this->attribute}", $button);
        }
        if ($this->form->enableClientScript) {
            $dfClientOptions = [];
            for ($i = 0; $i != count($form->attributes); $i++) {
                if (strpos($form->attributes[$i]['name'], $this->attribute) !== false) {
                    $dfClientOptions[] = $form->attributes[$i];
                }
            }
            $dfClientOptions = Json::encode($dfClientOptions);
            $formClientOptions = Json::encode($this->form->attributes);
            $js = <<<JS
(function(\$) {
    var dfClientOptions = {$dfClientOptions},
        \$form = \$('#{$this->form->id}');
    \$form.yiiActiveForm('data').attributes = {$formClientOptions};
    for (var i = 0; i != dfClientOptions.length; i++) {
        \$form.yiiActiveForm('add', dfClientOptions[i]);
    }
}(jQuery));
JS;
            $this->view->registerJs($js, View::POS_LOAD);
        }
        Pjax::end();
    }

作者:infoweb-internet-solution    项目:yii2-cms-alia   
// Buttons
?>
        <div class="pull-right">
            <?php 
echo Html::a(Yii::t('app', 'Create {modelClass}', ['modelClass' => Yii::t('infoweb/alias', 'Alias')]), ['create'], ['class' => 'btn btn-success']);
?>
    
        </div>
    </h1>
    
    <?php 
// Flash messages
?>
    <?php 
echo $this->render('_flash_messages');
?>

    <?php 
// Gridview
?>
    <?php 
Pjax::begin(['id' => 'grid-pjax']);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'kartik\\grid\\DataColumn', 'label' => Yii::t('app', 'Entity'), 'value' => 'entityTypeName'], ['class' => 'kartik\\grid\\DataColumn', 'label' => Yii::t('app', 'Name'), 'attribute' => 'entityModel.name', 'value' => 'entityModel.name', 'enableSorting' => true], ['class' => 'kartik\\grid\\DataColumn', 'label' => Yii::t('app', 'Url'), 'value' => function ($data) {
    return '/' . Yii::$app->language . '/' . $data->url;
}, 'enableSorting' => true], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{update}', 'updateOptions' => ['title' => Yii::t('app', 'Update'), 'data-toggle' => 'tooltip'], 'width' => '100px']], 'responsive' => true, 'floatHeader' => true, 'floatHeaderOptions' => ['scrollingTop' => 88], 'hover' => true, 'export' => false]);
?>

</div>

作者:hscstudi    项目:psiag   
/**
  * Ends the PJAX container
  */
 protected function endPjax()
 {
     if (!$this->pjax) {
         return;
     }
     echo ArrayHelper::getValue($this->pjaxSettings, 'afterGrid', '');
     Pjax::end();
 }

作者:absol311    项目:sonneboutiqu   
</div>
        </div>
        -->
        <!--/discount  panel end-->
    </div>
</div>

<!--right column-->
<div class="col-lg-9 col-md-9 col-sm-12">
    <div class="w100 clearfix category-top">
        <?php 
echo Html::tag('h2', $this->title);
?>
        <div class="categoryImage">
            <img src="/images/site/category.jpg" class="img-responsive" alt="img">
        </div>
    </div>

            <?php 
Pjax::begin();
?>
            <?php 
echo ListView::widget(['options' => ['id' => 'product-listview'], 'layout' => $template, 'dataProvider' => $dataProvider, 'itemOptions' => ['class' => 'item col-lg-3 col-md-3 col-sm-6 col-xs-12'], 'itemView' => function ($model, $key, $index, $widget) {
    return $this->render('_product_item', ['model' => $model]);
}, 'summaryOptions' => ['class' => 'pull-left']]);
?>
            <?php 
Pjax::end();
?>
    <!--/.categoryFooter-->
</div>


问题


面经


文章

微信
公众号

扫码关注公众号