我点击了这个链接 - PHPExcel integration into Zend Framework
如前所述复制文件/文件夹 -
> /library
> /PHPExcel
> /PHPExcel.php
并添加到 application.ini 文件中-
autoloaderNamespaces[] = "PHPExcel_"
autoloaderNamespaces[] = "PHPExcel"
现在mysite\application\modules\admin\controllers
,MysiteController.php
我正在以这种方式使用它-
public function getExcelDataAction()
{
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('A1:D1');
$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Swapnesh');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$filename = "my-data-sheet".".xlsx";
$objWriter->save($filename);
}
发生以下错误 -
Fatal error: Class 'PHPExcel' not found in C:\webserver\mysite\application\modules\admin\controllers\MysiteController.php on line 526
让我知道我怎样才能让它工作Zend
(zend初学者)