本文整理汇总了PHP中yii\widgets\Pjax::begin方法的典型用法代码示例。如果您正苦于以下问题:PHP Pjax::begin方法的具体用法?PHP Pjax::begin怎么用?PHP Pjax::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\widgets\Pjax
的用法示例。
在下文中一共展示了Pjax::begin方法的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: getPjaxBegin
protected function getPjaxBegin()
{
$html = '';
if ($this->pjax) {
ob_start();
Pjax::begin($this->pjaxOptions);
$html = ob_get_clean();
}
return $html;
}
示例3: 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
]);
}
示例4: 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
}
示例5: init
/**
* @inheritdoc
*/
public function init()
{
$this->registerAsset();
$this->registerScript();
Html::addCssClass($this->optionsPjax['options'], 'pjax-box');
Pjax::begin($this->optionsPjax);
}
示例6: init
public function init()
{
if (Yii::$app->request->isPjax) {
$id = Yii::$app->request->headers->get('X-PJAX-Container');
if ($id) {
$this->id = substr($id, 1);
$this->_pjax = Pjax::begin(ArrayHelper::merge(['id' => $this->getId(), 'linkSelector' => false, 'formSelector' => false, 'enablePushState' => false, 'enableReplaceState' => false], $this->pjaxOptions));
$this->_pjax->registerClientScript();
}
}
parent::init();
}
示例7: 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();
}
示例8: 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();
}
示例9: ActiveDataProvider
<!---Start Student Payment History Block--->
<div class="<?php
echo $model->isNewRecord ? 'box-success' : 'box-info';
?>
box col-xs-12 col-lg-12 no-padding">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-inr"></i><sup><i class="fa fa-clock-o"></i></sup> <?php
echo Yii::t('fees', 'Payment History');
?>
</h3>
</div>
<div class="box-body table-responsive no-padding">
<?php
$stuFeesData = app\modules\fees\models\FeesPaymentTransaction::find()->where(['fees_pay_tran_stu_id' => $stuData->stu_master_id, 'fees_pay_tran_collect_id' => $FccModel->fees_collect_category_id, 'is_status' => 0]);
$dataProvider = new ActiveDataProvider(['query' => $stuFeesData, 'sort' => ['defaultOrder' => ['fees_pay_tran_id' => SORT_DESC]], 'pagination' => ['pageSize' => 10]]);
\yii\widgets\Pjax::begin(['enablePushState' => FALSE]);
echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => "{items}\n{pager}", 'showOnEmpty' => true, 'emptyText' => Yii::t('fees', 'No fees results found.'), 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'fees_pay_tran_id', ['attribute' => 'fees_pay_tran_date', 'value' => function ($data) {
return Yii::$app->dateformatter->getDateDisplay($data['fees_pay_tran_date']);
}], ['attribute' => 'fees_pay_tran_mode', 'value' => function ($data) {
return $data->fees_pay_tran_mode == 1 ? "Cash" : "Cheque";
}], ['attribute' => 'fees_pay_tran_cheque_no', 'value' => function ($data) {
return !empty($data->fees_pay_tran_cheque_no) ? $data->fees_pay_tran_cheque_no : "-";
}], ['attribute' => 'fees_pay_tran_bank_id', 'value' => function ($data) {
return !empty($data->feesPayTranBank->bank_master_name) ? $data->feesPayTranBank->bank_master_name : "-";
}], 'fees_pay_tran_bank_branch', 'fees_pay_tran_amount', ['class' => 'app\\components\\CustomActionColumn', 'template' => '{update} {delete}']]]);
\yii\widgets\Pjax::end();
?>
</div><!---End Pannel Body Of Student Payment History--->
</div><!---End Payment History box Block--->
<!--/div--> <!--------End responcive div tag------>
示例10: function
$this->title = 'Факультеты';
?>
<h2>Факультеты</h2>
<?php
if (Yii::$app->user->can('createDeleteFaculty')) {
?>
<p>
<?php
echo Html::a('Новый факультет', ['create'], ['class' => 'btn btn-success actionCreate']);
?>
</p>
<?php
}
?>
<?php
Pjax::begin(['options' => ['id' => 'pjaxWrap']]);
echo GridView::widget(['dataProvider' => $provider, 'columns' => [['attribute' => 'name', 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
return Html::a(Html::encode($model->name), Url::to(['/program', 'idParent' => $model->id]), ['data-pjax' => '0']);
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => Yii::$app->user->can('createDeleteFaculty') ? '{update}{delete}' : '{update}', 'buttons' => ['update' => 'actionUpdate', 'delete' => 'actionDelete']]]]);
?>
<?php
Pjax::end();
?>
示例11: isset
/* @var $searchModel backend\models\OutSubsgroupVirtualSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Out Subsgroup Virtuals';
// $this->params['breadcrumbs'][] = $this->title;
$id = isset($_GET['id']) ? $_GET['id'] : "";
?>
<div class="out-subsgroup-virtual-index">
<p>
<?php
echo Yii::$app->Controllers->createMenuOperation(['page' => 'index', 'aksi' => ['create' => ['params' => ['#'], 'options' => ['onclick' => 'create(\'' . Url::to(['out-subsgroup-virtual/create', 'id' => $id], true) . '\')']]]]);
?>
</p>
<button type="button" class="btn btn-primary-budi" id="search-data-out-subsgroup-virtual">Advanced Search</button>
<br><br>
<?php
Pjax::begin(['id' => 'out-subsgroup-virtual-grid', 'enablePushState' => false]);
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'hover' => true, 'filterSelector' => "input[name='" . $dataProvider->getPagination()->pageSizeParam . "'],input[name='" . $dataProvider->getPagination()->pageParam . "']", 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => '<h4>' . Html::encode($this->title) . '</h4>'], 'columns' => [['attribute' => 'virtual_id', 'value' => 'virtual.name'], ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Actions', 'buttons' => ['delete' => function ($url, $model, $key) {
$url = $_SERVER["SCRIPT_NAME"] . '?r=out-subsgroup-virtual/delete&id=' . $model->id;
return Html::a('<span class="glyphicon glyphicon-trash"></span>', '#', ['title' => Yii::t('yii', 'Delete'), 'class' => 'delete']);
}, 'view' => function ($url, $model, $key) {
// return "<span class='glyphicon glyphicon-eye-open'></span>";
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', '#', ['title' => Yii::t('yii', 'View'), 'class' => 'view']);
}, 'update' => function ($url, $model, $key) {
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', '#', ['title' => Yii::t('yii', 'Update'), 'class' => 'update']);
}]]]]);
?>
<?php
Pjax::end();
?>
示例12: function
<?php
use bl\cms\shop\common\entities\ShopAttribute;
use bl\cms\shop\common\entities\ShopAttributeValueColorTexture;
use yii\grid\GridView;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\widgets\Pjax;
?>
<?php
Pjax::begin(['enablePushState' => false, 'timeout' => 5000]);
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterRowOptions' => ['class' => 'm-b-sm m-t-sm'], 'options' => ['class' => 'project-list'], 'tableOptions' => ['id' => 'my-grid', 'class' => 'table table-hover'], 'summary' => "", 'columns' => ['id', ['label' => \Yii::t('shop', 'Title'), 'value' => 'translation.title'], ['attribute' => 'value', 'value' => function ($model) {
$attribute = ShopAttribute::findOne($model->attribute_id);
if ($attribute->type_id == 3) {
$color = ShopAttributeValueColorTexture::findOne($model->translation->value)->color;
return Html::tag('div', '', ['style' => 'width: 50px; height: 50px; background-color:' . $color]);
}
if (ShopAttribute::findOne($model->attribute_id)->type_id == 4) {
return ShopAttributeValueColorTexture::getTexture($model->translation->value);
}
return $model->translation->value;
}, 'format' => 'raw']]]);
?>
<div class="shop-attribute-value-form">
<?php
示例13:
</div>
<div class="panel panel-default background-white">
<div class="panel-heading"> <?php
echo \Yii::t('app/views', 'product settings');
?>
</div>
<?php
Pjax::begin(['id' => 'product-grid']);
?>
<?php
echo $this->render('/product/grid');
?>
<?php
Pjax::end();
?>
<div class="panel-body well">
<?php
Pjax::begin(['enableReplaceState' => false, 'enablePushState' => false, 'options' => ['id' => 'product-form', 'data' => ['pjax-end' => '#product-grid']]]);
?>
<?php
echo $this->render('/product/form', ['model' => $model['product']]);
?>
<?php
Pjax::end();
?>
<?php
echo Html::a(Yii::t('app/views', 'reset'), '/product/create', ['class' => 'btn btn-success', 'data' => ['ajax-get' => '#product-form']]);
?>
</div>
</div>
示例14:
* @var yii\data\ActiveDataProvider $dataProvider
* @var app\models\FileSearch $searchModel
*/
$this->title = $searchModel->getAliasModel(true);
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="giiant-crud file-index">
<?php
// echo $this->render('_search', ['model' =>$searchModel]);
?>
<?php
\yii\widgets\Pjax::begin(['id' => 'pjax-main', 'enableReplaceState' => false, 'linkSelector' => '#pjax-main ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
?>
<h1>
<?php
echo $searchModel->getAliasModel(true);
?>
<small>
List
</small>
</h1>
<div class="clearfix crud-navigation">
<div class="pull-left">
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'New'), ['create'], ['class' => 'btn btn-success']);
?>
示例15:
<li><a href="#" data-toggle="modal" data-target="#modalDeposito" >Deposito</a></li>
</ul>
</div>
<a href="<?= Yii::$app->urlManager->createUrl(['parcela'])?>" type="button" class="btn btn-primary"><i class="fa fa-minus-circle"></i> Parcelas</a>
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#modalAvulso"><i class="fa fa-minus-circle"></i> Avulso</button>
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#modalReforco"><i class="fa fa-minus-circle"></i> Reforço</button>
<a href="<?= Yii::$app->urlManager->createUrl(['caixa/fechar'])?>" class="btn btn-danger"><i class="fa fa-times"></i> Fechar</a>
</div>
<div class="col-md-3">
<h3><?php echo Yii::$app->formatter->asCurrency($caixa->valor) ?> </h3>
</div>
</div>
<div class="row">
<div class="col-md-12">
<?php Pjax::begin(); ?>
<?= DynaGrid::widget([
'columns' => $columns,
'theme' => 'panel-danger',
'showPersonalize' => false,
'gridOptions' => [
'dataProvider' => $dataProvider,
//'filterModel' => $searchModel,
'showPageSummary' => false,
],
'options' => ['id' => 'dynagrid-1'],
]); ?>
<?php Pjax::end(); ?>
</div>
</div>