CodeIgniter Forums
loading CI instance from helper? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: loading CI instance from helper? (/showthread.php?tid=83066)



loading CI instance from helper? - protopigeon - 09-16-2022

Hi folks
I'm converting a CI3 project to CI4
My old project loaded in the CI3 instance like this from a site_helper I created
Code:
$CI =& get_instance();
and would then happily go about its business using all the usual libraries etc, like this
Code:
$get = $CI->input->get();
$home_url = $CI->config->item("home_url");

Etc.

However, this does not work in CI4.x

Is there a way to do this or am i barking up the wrong tree, I couldn't see anything about this in the online documentation.

Many thanks for any help

P



RE: loading CI instance from helper? - protopigeon - 09-16-2022

Also - is there an equivalent to uri_to_assoc() in CI4? Can't see it in the docs