Home > Article > Backend Development > TP5 Excel export download convenient class library
TP5 Excel export download project references PHPExcel1.8
The controller class calling method supports chain operations
Quickly export Excel
You only need to define the display fields and query conditions to be downloaded
Support multiple tables output to one EXCEL
$excel=new Excel(); $table_name="mk_material_list_edit"; $field=["id"=>"序号","guid"=>"项目代码","name"=>"项目名称"]; $map=["status"=>1]; $map2=["status"=>-1]; $excel->setExcelName("下载装修项目") ->createSheet("装修项目",$table_name,$field,$map) ->createSheet("已删除装修项目",$table_name,$field,$map2) ->downloadExcel(); //快速导入 $getExcelobject=Excel::loadExcel("test.xls"); $sheetName=$getExcelobject->getSheetNames(); dump($sheetName); $sheet = $getExcelobject->getSheetByName($sheetName[0])->toArray(); dump($sheet);
The above is the detailed content of TP5 Excel export download convenient class library. For more information, please follow other related articles on the PHP Chinese website!