Accsess my Libraries from Models |
There's no difference in loading a library from a controller or from a model. You can create a new instance of your class the standard PHP way:
PHP Code: $myLib = new MyLib(); Or you can define a service. This allows to get a shared instance if you need to access your library in multiple places, instead of creating a new object everytime.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Messages In This Thread |
Accsess my Libraries from Models - by Anton_BNV - 09-01-2021, 05:04 AM
RE: Accsess my Libraries from Models - by includebeer - 09-05-2021, 04:00 PM
|