Welcome Guest, Not a member yet? Register   Sign In
How to add data when loading CI4 library
#5

Sorry, I guess I misunderstood your question.
So you have your own library and want to rewrite it to work with CI4?

In that case, instead of
PHP Code:
$this->load->library('whatever'$config); 
you will do
PHP Code:
$whatever = new \App\Libraries\Whatever($config); 

Alternatively, you can also use service to get a single instance every time: https://codeigniter.com/user_guide/conce...vices.html

If that again not what you're asking for, I'm afraid you have to explain the question better.
michalsn.dev - mostly about CodeIgniter
Reply


Messages In This Thread
RE: How to add data when loading CI4 library - by michalsn - 04-06-2025, 08:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB