• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using output in Custom Library

Hi folks,

I have created a custom library and when I make a call to $this->output->set_status_header(404); I get PHP Fatal error: Call to a member function set_status_header() on a non-object.

I didn't think i needed to load the core output class in a custom library. A snapshot of the class is as follows:
class Rest {
    private $CI;

    function __construct() {
        $this->CI =& get_instance();

     function response($data) {

If anyone has any ideas I'd appreciate it.


you need to use the CI object you defined in the constructor


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.