We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

How to setup phpexcel in namespace

Hi all Directories phpexcel in app/library/PHPExcel, and file loader.php contain $loader = new \Phalcon\Loader();


  • We're a registering a set of directories taken from the configuration file */ $loader->registerNamespaces(array( 'Eduapps\Models' => $config->application->modelsDir, 'Eduapps\Controllers' => $config->application->controllersDir, 'Eduapps\Forms' => $config->application->formsDir, 'Eduapps' => $config->application->libraryDir ));

$loader->register(); and in files PHPExcel.php <?php namespace Eduapps\PHPExcel; but run public function excelAction() { $excel = new PHPExcel(); Fatal error: Class 'Eduapps\PHPExcel\PHPExcel_Calculation' not found in /home/opensue/www/eduapps/app/library/PHPExcel/PHPExcel.php on line 124 and tries namespace Eduapps\PHPExcel in file Calculation.php has not been

Just register the directory.


$loader->registerDirs( array( $config->application->libraryDir."PHPExcel/" ) );


$excel = new PHPExcel();



Thank Douglas Bezerra Possas but i use $loader->registerNamespaces, and i slove problem above

Can you explain how to solve this problem?

Hello. This link is the solution.


Can you explain how to solve this problem?

— Reply to this email directly or view the complete thread on Phosphorum http://forum.phalcon.io/discussion/1025/how-to-setup-phpexcel-in-namespace#C15531. Change your e-mail preferences here http://forum.phalcon.io/settings

-- Douglas Bezerra Possas