Yii2: how to save url in picture?

I use the kartik grid view to display my data in yii 2 with pjax enabled. Every time I browse the data in a grid, the search is done using ajax, but the url keeps changing. Is there a way to keep the URL unchanged? Please help me with the solution. Here is my code:

<?php use kartik\grid\GridView;?> <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax'=>true, 'pjaxSettings'=>[ 'neverTimeout'=>true, ], 'columns' => [ ['class' => 'yii\grid\SerialColumn'], 'hotel_id', 'name', 'address', 'phone_no', 'contact_person', // 'email_address:email', // 'website', ['class' => 'yii\grid\ActionColumn'], ], ]); ?> 
+5
source share
1 answer

You can disable the pushState function as follows:

 'pjax' => true, 'pjaxSettings' => [ 'options' => [ 'enablePushState' => false, ], ], 
+7
source

Source: https://habr.com/ru/post/1208630/


All Articles