CodeIgniter Forums

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

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 :

Message: Class 'Spreadsheet' not found

What have I forgotten ?
Thanks for the help.
How are you using it in your code? Perhaps you are forgetting the use statement at the top of the class file?
PHP Code:
use PhpOffice\PhpSpreadsheet\Spreadsheet

The error text "Message: Class 'Spreadsheet' not found" means that you are try to create instance a class without a namespace.

With a namespace, the error text would be like this: Message: Class 'PhpOffice\PhpSpreadsheet\Spreadsheet' not found