Creates an empty PHPExcel Object if the filename is empty, otherwise loads the file into the object.
public createPHPExcelObject ( string $filename = null ) : PHPExcel | ||
$filename | string | |
Результат | PHPExcel |
/** * @inheritdoc */ public function createExportObject(Datagrid $datagrid) { $this->phpExcel = $this->factory->createPHPExcelObject(); $this->phpExcel->setActiveSheetIndex(0); $this->phpExcel->getActiveSheet()->setTitle('Datagrid export'); // Set the column headers $c = 'A'; foreach ($columns = $datagrid->getColumns() as $column) { $this->phpExcel->getActiveSheet()->setCellValue($c . '1', $column->getLabel()); $c++; } return $this->phpExcel; }
public function testCreate() { $factory = new Factory(); $this->assertInstanceOf('\\PHPExcel', $factory->createPHPExcelObject()); }