How to use PHPExcel with tp5.
How to use PHPExcel with tp5
I haven't directly called phpexcel in tp5, but one of my projects also needs to use phpexcel. I went full circle and added phpexcel to tp5 externally. The idea is as follows:
1. Directly download phpexcel to a directory in tp5. phpexcel can be used directly, and the download comes with many demo examples. The main meaning is to parse an excel file into an array. All we need is this array.
2. Prepare the uploaded excel file through the tp5 background, and set the upload path to a folder that phpexcel needs to read in the first step. Then pass it to the phpexcel file and file name through get.
3. phpexcel parses the excel file name passed from a file under tp5 into an array.
4. Store this array in the database. The database link I wrote here manually and natively is very verbose and cannot be easily maintained. The ideal state is to at least pass this array back to the tp5 framework for processing. I have not found a way to pass it back.