How to use PHPExcel correctly with Symfony 2

前端 未结 6 1885
情话喂你
情话喂你 2020-12-24 09:51

I need to use PHPExcel with a Symfony2 project. Anyone know how to set up the project correctly to use the library? Should i put it in the vendor directory? Wha

6条回答
  •  悲哀的现实
    2020-12-24 10:05

    1. Copy the library to your vendors directory.
    2. Configure autoloader in your bootstrap file:

      $loader->registerPrefixes(array(
          // Swift, Twig etc.
          'PHPExcel' => __DIR__ . '/../vendor/phpexcel/lib/PHPExcel'
      ));
      
    3. That's all.

提交回复
热议问题