Приведу часть кода во вьюхе:
Код: Выделить всё
<p id="pp" class="btn btn-primary">Выбрать</p>
<?php Pjax::begin(['id' => 'pj0']); ?>
<p>Мой контент</p>
<?php if ($_GET['x']) echo $_GET['x']; ?>
<?php Pjax::end(); ?>
Код: Выделить всё
$('#pp').click(function(event) {
event.preventDefault();
$.pjax.reload({
container: '#pj0',
type : 'GET',
url : '/tenders/test',
data : {'x':123},
timeout : false,
});
});
Код: Выделить всё
public function actionTest(){
$x=($_GET['x'])?$_GET['x']:'no get';
return $this->render('test',['x'=>$x]);
}