CodeIgniter Forums
Getting info from the pre_controller hook - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Getting info from the pre_controller hook (/showthread.php?tid=11269)



Getting info from the pre_controller hook - El Forum - 09-02-2008

[eluser]FinalFrag[/eluser]
Hi there,

I have a pre_controller hook that executes the function 'example' which looks like this:
Code:
function example() {
    return 'testvar';
}

Now my question is rather simple...
How can I access the return value (in this case testvar) in my controller?

Thnx


Getting info from the pre_controller hook - El Forum - 09-02-2008

[eluser]FinalFrag[/eluser]
23 views already and no-one knows this?


Getting info from the pre_controller hook - El Forum - 09-02-2008

[eluser]Randy Casburn[/eluser]
Hi Final - The config object instantiated at this point and is available (as $CFG) and can be used as a pseudo registry to store variables for use in your controllers.

Try that.

Randy


Getting info from the pre_controller hook - El Forum - 09-02-2008

[eluser]Randy Casburn[/eluser]
Just took me a minute %-P