我已经创建了函数导出excel这个代码在另一个模块中工作
$filename='tajima_sparepart_'.date('Y-m-d_H-i').'.xlsx';
ob_end_clean();
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="'.$filename.'"');
header('Cache-Control: max-age=0');
$objWriter = IOFactory::createWriter($this->excel, 'Excel2007');
$objWriter->save('php://output');
但是什么时候出口,它告诉我:
输出可能暂时关闭,或者可能已永久移动到新的网址。
谁有解决方案?
我忘了加载IOFactory类
$this->load->library('PHPExcel/IOFactory.php');