var csrfToken = $('meta[name="csrf-token"]').attr("content");
$.ajax({
.....
data: {param1: param1, _csrf : csrfToken},
});
If ($_GET['mode'] == 1 ) {
$this->layout='//layouts/column2';
} else {
$this->layout='//layouts/column1';
}
'user_id' => array(
'name' => 'user_id',
'value' => function($data){return $data->user_id ? $data->user->username : 'guest';}
'filter' => User::all(),
),
$news = Yii::$app->params['site']->getNews()->orderBy('id desc')->limit(2)->all()
$news = Yii::$app->params['site']->getNews()->andWhere(['type' =>1])->all()