2017-06-17 14:30:12 4702次浏览 3条回答 0 悬赏 39 金钱

下载安装包后引入vender
在PHPExcell中添加命名空间 namespace phpoffice;

在Autoloader.php中
public static function Register() {

    if (function_exists('__autoload')) {
        //    Register any existing autoloader function with SPL, so we don't get any clashes
        spl_autoload_register('__autoload');
    }
    //    Register ourselves with SPL
    if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
        return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'), true, true);
    } else {
        return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'));
    }

}   //    function Register()

controller中:
use phpoffice\PHPExcel;

public function actionText()

{
    $a = new PHPExcel();

}

报错:Class 'phpoffice\PHPExcel_Calculation' not found

public function __construct()

{
    $this->_uniqueID = uniqid();
    $this->_calculationEngine	=  PHPExcel_Calculation::getInstance($this);
您需要登录后才可以回答。登录 | 立即注册
daisy888
助理

daisy888

注册时间:2017-04-16
最后登录:2018-03-14
在线时长:12小时2分
  • 粉丝0
  • 金钱60
  • 威望0
  • 积分180

热门问题