with the recursive function ,
I can generate the array ,
[
1 => 'root1',
2 => ' root1 child1',
3 => ' root1 child2',
4 => 'root2',
5 => ' root2 child1',
6 => ' root2 child2',
]
but if I want to give the level indented data to the the activeDataProvider, it does't work.
anyway I can provide this kind of data to the ActiveDataProvider.
I don't think a simple sql statement can generate result like the array above.
$dataProvider = new ActiveDataProvider([
'query' => Post::find(),
'pagination' => [
'pageSize' => 20,
],
]);
echo GridView::widget([
'dataProvider' => $dataProvider,
]);
--test--
with the recursive function ,
I can generate the array ,
but if I want to give the level indented data to the the activeDataProvider, it does't work.
anyway I can provide this kind of data to the ActiveDataProvider.
I don't think a simple sql statement can generate result like the array above.
--test--