Answer the question
In order to leave comments, you need to log in
Is it possible to pass sort to select?
Hello!
There are a couple of questions about sorting:
1) There is sorting:
Use yii\data\Sort;
$sort = new Sort([
'attributes' => [
'views' => [
'label' => 'По популярности',
],
'group1' => [
'label' => 'По цене',
]
],
]);
echo $sort->link('group1') . ' | ' . $sort->link('views');
<select>
<option value="">По цене(по убыванию)</option>
<option value="">По цене(по возрастанию)</option>
<option value="">По популярности(по убыванию)</option>
<option value="">По популярности(по возрастанию)</option>
</select>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question