PHPExcel integration into Zend Framework

前端 未结 6 717
忘了有多久
忘了有多久 2021-01-12 12:00

how can I integrate the PHPExcel into my Zend app.

My actual folder structure is the following:

/application
  controllers
  views  
  etc...
/librar         


        
6条回答
  •  清酒与你
    2021-01-12 12:19

    Additionally I added a "\" on the line where PHPExcel_IOFactory uses In Controller Class:

    public function reporteauditoriaAction()
    {
        $objPHPExcel = new \PHPExcel();
        $objPHPExcel->createSheet();
        $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Alejin Wbn');
        $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, "Excel2007");
        $objWriter->save("pruebaPhpExcelZend.xlsx"); 
        //$objPHPExcel->disconnectWorksheets();
        //unset($objPHPExcel);
        $consulta= "Reporte Auditoria, Reconocio los Archivos";
        $vista = new ViewModel(array( "consulta"=>$consulta));
        return $vista;        
    }
    

提交回复
热议问题