CodeIgniter Forums

Full Version: Use the codeigniter library in hook class or function,HOWTO
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
Hi all:
How use the codeigniter library in hook class or function, such as database class.
Hook Point: pre_controller.
Tks.

El Forum

[eluser]Seppo[/eluser]
If you want to use a library, you would need to use a hook at least in post_controller_constructor. There you can be sure the basic core is loaded.
Then you can use get_instance() to get the controller object and access to the libraries.

El Forum

[eluser]Unknown[/eluser]
Thank you very much, Seppo!
I now understand.