![]() |
Hooking display_override - $this->output->get_output not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Hooking display_override - $this->output->get_output not working (/showthread.php?tid=7986) |
Hooking display_override - $this->output->get_output not working - El Forum - 04-30-2008 [eluser]Stuart Marsh[/eluser] I'm trying to use the display_override hook to edit output before it gets to the user. I created the following hook: Code: class display_hook { I get this error: Code: Message: Undefined property: Display_Hook::$output Code: class display_hook extends Controller { Code: Message: Undefined property: Display_Hook::$DB_Content So I have two questions: 1 - What is the correct format for a hook class so I can use $this->output->get_output()? 2 - Why can't I load a model when I extend the controller for my hook? Any help would be appreciated. Hooking display_override - $this->output->get_output not working - El Forum - 07-29-2008 [eluser]Unknown[/eluser] Are you ensuring that you make a reference to the CI superobject before you make a call to get_output on it? i.e.: Code: $this->CI =& get_instance(); Hooking display_override - $this->output->get_output not working - El Forum - 07-29-2008 [eluser]Stuart Marsh[/eluser] oops should have updated this. I posted this as a bug here: http://codeigniter.com/bug_tracker/bug/4512/ The manual used to say that $this->output->get_output() would work, but has since been changed to reflect the correct code. |