Answer the question
In order to leave comments, you need to log in
Sorting an array in Yii2?
The bottom line is that I have a category table that is linked to itself. That is, a category can have a parent category from the same table by the "parent_id" key. The task is that I need a list of all categories in the form of an array, but sorted as follows:
[
'Родительская категория',
'Дочерня категория 1',
'Дочерняя категория 2',
'Дочерняя категория 3',
'Родительская категория 2',
'Дочерняя категория 1',
'Дочерняя категория 2'
]
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