$this->output in display_override Hook |
|||
|---|---|---|---|
| Date: | 05/11/2008 | Severity: | Minor |
| Status: | Resolved | Reporter: | Stuart Marsh |
| Version: | 1.6.1 | ||
| Keywords: | User Guide | ||
| Forum Thread: | 78278 | ||
Description
The user guide states you can use $this->output->get_output() in a display_override hook but this doesn’t work.
The error given is
Message: Undefined property: Display_Hook::$output
Call to a member function _display() on a non-object
Code Sample
class display_hook {
function NewOutput()
{
$content = $this->output->get_output();
}
}
Expected Result
Actual Result
Message: Undefined property: Display_Hook::$output
Call to a member function _display() on a non-object
Comment on Bug Report
| Posted by: Derek Jones on 11 May 2008 3:10pm | |
|
|
Good catch, Stuart, you’ll need to either reference the global $OUT variable, or fetch the CI superobject with get_instance():
class display_hook {
|
