Home computickets CodeIGNITER 4 Connecting a third-party library

CodeIGNITER 4 Connecting a third-party library

Author

Date

Category

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

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions