问答详情
源自:5-5 PHPExcel 合并单元格

tp框架加那个默认水平垂直居中就包错了,代码没有写错呀

$sheet=$PHPExcel->getActiveSheet();//获得当前活动的单元格


        $sheet->getDefaultStyle()->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER)->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);//设置excel文件默认水平垂直方向居中

:(

Class 'Home\Controller\PHPExcel_Style_Alignment' not found

错误位置

FILE: D:\WWW\phpexcel\Application\Home\Controller\IndexController.class.php  LINE: 102


提问者:qq_一个人的落寞_0 2016-03-05 17:14

个回答

  • 圆圆的圈圈
    2016-03-06 10:48:51

    PHPExcel_Style_Alignment前面加反斜杠\