【发布时间】:2016-06-07 12:43:12
【问题描述】:
我只是从这里 https://github.com/Maatwebsite/Laravel-Excel/ 设置 Maatwebsite/Laravel-Excel 插件。我想在 laravel 的刀片中读取 excel 文件并在 Html 表中显示数据。我通过以下方式获取数据:
$content=Excel::load($file, function($reader) {
})->get();
当我回显 $content;我有关注::
SheetCollection {#762 ▼
#title: ""
#items: array:3 [▼
0 => RowCollection {#623 ▼
#title: "Sheet1"
#items: array:4 [▼
0 => CellCollection {#693 ▼
#title: null
#items: array:2 [▼
"name" => "Abc"
"city" => "City1"
]
}
1 => CellCollection {#692 ▼
#title: null
#items: array:2 [▼
"name" => "Xyz"
"city" => "city2"
]
}
2 => CellCollection {#710 ▼
#title: null
#items: array:2 [▼
"name" => "Name2"
"city" => "city3"
]
}
3 => CellCollection {#709 ▼
#title: null
#items: array:2 [▼
"name" => "Name2"
"city" => "city3"
]
}
]
}
1 => RowCollection {#728 ▼
#title: "Sheet2"
#items: []
}
2 => RowCollection {#697 ▼
#title: "Sheet3"
#items: []
}
]
}
这些是我的 xlsx 文件中的数据。现在我想在 view Blade 上渲染它。任何想法????谢谢
【问题讨论】:
标签: laravel