CodeIgniter Forums
Undefined property? - 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: Undefined property? (/showthread.php?tid=57491)



Undefined property? - El Forum - 03-18-2013

[eluser]whygod[/eluser]
Hi guys

I have these simple codes below,
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Front extends CI_Controller
{
public $data = array();

    function __construct ()
    {
  $this->load->helper('url');
  $this->load->helper('form');
  $this->load->library('email');

  $this->data['header'] = 'header';
  $this->data['body']   = 'body';
  $this->data['footer'] = 'footer';
}

function index() {
  //$this->data['header'] = $this->load->view('template/header', $this->data, TRUE);
  //$this->data['footer'] = $this->load->view('template/footer', $this->data, TRUE);
  $this->load->view('template/master', $this->data);  
}


}

and the error is,
Code:
A PHP Error was encountered
   Severity: Notice
   Message: Undefined property: Front::$load
   Filename: controllers/front.php
   Line Number: 9

So basically I'm just loading the helper here the first $this->load class.
So why is this error showing?, can some one please explain to me.

Thanks in advanced.



Undefined property? - El Forum - 03-18-2013

[eluser]whygod[/eluser]
Okay problem solved.
I forgot to include this codes below,
Code:
parent::__construct();