Search code examples
zend-framework2phpexcel

Integrate PHPExcel in Zend Framework 2


Using composer I have downloaded the PHPExcel class. The directory structure is

codeplex 
+-phpexcel  
  +-PHPExcel

now I am confuse how to enable PHPExcel class in application.config.php OR should i remove the extra folder structure?

I know it's a basic question but I am just getting fatal error around enabling this.


Solution

  • PHPExcel is not a ZF2 module, so you don't need to do anything to enable it. Since you've installed it via. Composer, Composer will have setup the autoloading for you, so you should be able to use the PHPExcel classes in your existing module(s):

    use PHPExcel;
    
    $excel = new PHPExcel(); 
    
    [etc.]