0
我正在使用Yii2並重構一些代碼。我打電話一些Oracle存儲過程返回回來,像這樣的數據:Gridviews與陣列陣列
Array
([ATTENDING] => Array
(
[0] => Person 1
[1] => Person 2
[2] => Person 3
)
[PREVIOUS_YEAR] => Array
(
[0] => 15
[1] => 10
[2] => 2
)
...
)
我試圖使用中的GridView此陣,但發現我的列是空白的,我想這一點:
$provider = new ArrayDataProvider([
'allModels' => $data,
'sort' => [
'attributes' => ['ATTENDING',
'PREVIOUS_YEAR',
...
],
],
'pagination' => [
'pageSize' => 10,
],
]);
它返回12行(查詢返回的列數),但數據中只返回了三行。