CodeIgniter Forums

Full Version: Unable to use library from composer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have a problem with my composer library.
I just start to use composer so, I made the setup and I have in my Application folder the composer.json, the composer.lock, I installed the phpspreadsheet library. All the files are in the vendor folder.
Finally, I change my config.php with the autoload composer to TRUE.

I have always the same error :

Code:
Message: Class 'Spreadsheet' not found

What have I forgotten ?
Thanks fot the help.

Fran├žois
(01-09-2018, 07:47 AM)fwillemin Wrote: [ -> ]Hello,

I have a problem with my composer library.
I just start to use composer so, I made the setup and I have in my Application folder the composer.json, the composer.lock, I installed the phpspreadsheet library. All the files are in the vendor folder.
Finally, I change my config.php with the autoload composer to TRUE.

I have always the same error :

Code:
Message: Class 'Spreadsheet' not found

What have I forgotten ?
Thanks fot the help.

Fran├žois

Did you add

Code:
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;

in the head?

https://phpspreadsheet.readthedocs.io/en/develop/

edit:

is the vendor folder in the application folder?
Hello,

I tried to set those lines in the function so it will not work...
I put them in the head and now it's ok.

Thanks for your help.