YII框架调用插件PHPExcel的时候出现路径导入问题

http://www.yiiframework.com/wiki/101/how-to-use-phpexcel-external-library-with-yii/#hh3

问题出现的原因:

YII框架有自己的路径加载机制(YiiBase类)

/**
	 * Class autoload loader.
	 * This method is provided to be invoked within an __autoload() magic method.
	 * @param string $className class name
	 * @return boolean whether the class has been loaded successfully
	 */
	public static function autoload($className)  ----大概在394行

PHPExcel也有自己的路径加载机制

"

PHPExcel has an autoloading feature itself that when a classes is called (i.e. PHPExcel_Shared_ZipStreamWrapper) the first part of the name is actually reflecting the folder's path where the class is located (i.e. PHPExcel_Shared_ZipStreamWrapper = PHPExcel/Shared_ZipStreamWrapper.php). Please review the following code (extracted fromPHPExcel_Autoloader class):

"

代码执行的时候,会发生YII框架的类加载机制,去加载PHPExcel中需要加载的类。

但是PHPExcel里面的类又有点不同,就像上面英文里面举例描述的。所以问题出现。


解决办法在链接中。两个办法。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值