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里面的类又有点不同,就像上面英文里面举例描述的。所以问题出现。


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

你可能感兴趣的:(phpexcel,yii)