1. Через Request
if(!\Yii::$app->request->get('sort')) {
Yii::$app->request->setQueryParams(['sort' => 'name']);
}
2. Через редирект
if(!\Yii::$app->request->get('sort')) {
$this->redirect(['view', 'sort' => 'name']);
}
3. В DataProvider
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => [
'defaultOrder' => [
'name' => SORT_ASC
]
],
]);