How to connect a third-party library in CodeIGNITER 4? In particular phpexcel. In Ci 3, it was enough to throw it into the Libraries folder and make $ this- & gt; Load- & gt; Library ('phpexcel')
.
Now everything is also located in the Libraries folder.
I am trying through Use App \ Libraries \ phpexcel
an error that class is not found.
I am trying through the include, Require, Require_ONCE is already an error that the controller is not found.
When running the next line
$ excel = new phpexcel ();
Answer 1
$ this- & gt; excel = new phpexcel ();
From the transition instructions from 3.x to 4.x
Libraries
- Your app CLASSES CAN STILL GO INSIDE App / Libraries, But The Don’t Have To;
- Instead of Ci3’s
$ this- & gt; load- & gt; library (x);
you can now use$ this- & gt; x = new x ();
, Fallowing Namespaced Conventions for Your Component