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.

Example

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

$loader->register();

$excel = new PHPExcel();

...



32.6k

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.

http://stackoverflow.com/questions/19303339/create-excel-file-in-phalcon-php-framework

Can you explain how to solve this problem?

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

-- Douglas Bezerra Possas