When you try to include the PHPExcel library into a joomla article (using a plugin for inserting PHP code into an article), it doesn’t work. It displays a white screen. I found a solution for that. It maybe not the best way to fix this sinceĀ I’ve modified the Joomla core.
Go to /libraries/loader.php and replace:
function __autoload($class)
{
if(JLoader::load($class)) {
return true;
}
return false;
}
with:
function Joomla_Autoload($class) {
if(JLoader::load($class)) {
return true;
}
return false;
}
/*** specify extensions that may be loaded ***/
spl_autoload_extensions('.php, .class.php, .lib.php');
/*** register the loader functions ***/
spl_autoload_register('Joomla_Autoload');
2 Comments
Great post however I was wondering if you could write a litte more on this subject? I’d be very thankful if you could elaborate a little bit more. Appreciate it!
For component developers who need to integrate with PHPExcel, there is also a library with PHPExcel build for Joomla.
You can check it out here: https://github.com/vdespa/PHPExcel-Joomla-Library