Yii include PHP Excel
Posted
by
Anton Sementsov
on Stack Overflow
See other posts from Stack Overflow
or by Anton Sementsov
Published on 2012-03-22T17:10:57Z
Indexed on
2014/05/29
21:28 UTC
Read the original article
Hit count: 475
Im trying include PHPExcel lib to Yii, put PHPExcel.php
in root of extensions, near PHPExcel
folder and added that code into config/main.php
// application components
'components'=>array(
'excel'=>array(
'class'=>'application.extensions.PHPExcel',
),
modify /protected/extensions/PHPExcel/Autoloader.php
public static function Register() {
$functions = spl_autoload_functions();
foreach($functions as $function)
spl_autoload_unregister($function);
$functions=array_merge(array(array('PHPExcel_Autoloader', 'Load')), $functions);
foreach($functions as $function)
$x = spl_autoload_register($function);
return $x;
}// function Register()
Then, trying create PHPExcel object $objPHPExcel = new PHPExcel();
but have an error: include(PHPExcel.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory
in Z:\home\yii.local\www\framework\YiiBase.php(418)
© Stack Overflow or respective owner