createWriter() public method

Create a writer given the PHPExcelObject and the type, the type coul be one of PHPExcel_IOFactory::$_autoResolveClasses
public createWriter ( PHPExcel $phpExcelObject, string $type = 'Excel5' ) : PHPExcel_Writer_IWriter
$phpExcelObject PHPExcel
$type string
return PHPExcel_Writer_IWriter
コード例 #1
0
ファイル: ExcelExport.php プロジェクト: Opifer/CrudBundle
 /**
  * @inheritdoc
  */
 public function createResponse()
 {
     $writer = $this->factory->createWriter($this->phpExcel, 'Excel5');
     $response = $this->factory->createStreamedResponse($writer);
     $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');
     $response->headers->set('Content-Disposition', 'attachment;filename=datagrid-export.xls');
     $response->headers->set('Pragma', 'public');
     $response->headers->set('Cache-Control', 'maxage=1');
     return $response;
 }