CodeIgniter Forums
External library() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: External library() (/showthread.php?tid=79571)



External library() - darmexx1 - 07-03-2021

I have a system made in native php, which I am moving to codeigniter 4, and I need to know how to include other files as shown in the photo. any help I am grateful.




RE: External library() - InsiteFX - 07-03-2021

You can still include them like that or you can give them all the App\Libraries namespace
and then CodeIgniter would find them.

Top of class file use App/Libraries

You can have the also autoloaded using App/Config/Autoload.php

Look at the bottom of the file there is a files array to add them to.


RE: External library() - ikesela - 07-04-2021

you can store those file in App folder, make it name SII,

each file add (namespace represent folder location of your file for autoload to work)
<?php
namespace App\SII ;
-- your class here..

to use those class just add on controller

use App\SII\{class-name1,class-name2},