"post controller" Hook Problem - 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: "post controller" Hook Problem (/showthread.php?tid=19198) |
"post controller" Hook Problem - El Forum - 05-31-2009 [eluser]Unknown[/eluser] Hi. I can't get the instance in the post controller hook. Here is my Sourcecode. Code: // config/autoload.php Code: // libraries/MY_Controller.php If i use global $CI the output is right. Code: // libraries/MY_Controller.php What's the problem? How can i get rid of the "global $CI"? Can anyone help? Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 I tested the same on my Linux Server with Apache 2.2 and PHP4 and there is the get_instance version working... Greetings, Wolfgang "post controller" Hook Problem - El Forum - 05-31-2009 [eluser]TheFuzzy0ne[/eluser] Welcome to the CodeIgniter forums. I'm no expert on hooks, but you should not need to obtain a reference to the CodeIgniter Super Object, as you are already within that scope. "post controller" Hook Problem - El Forum - 06-14-2009 [eluser]Unknown[/eluser] Can no one help? "post controller" Hook Problem - El Forum - 06-14-2009 [eluser]wiredesignz[/eluser] Don't even try to call the controller in a post controller hook. $CI is a global variable that is used to hold the controller object and is available until the CodeIgniter script finishes. You should perhaps define a custom class or function in the hooks directory and by using global $CI you will then get access to your test method. Code: global $CI; |