• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undefined property?

#1
[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.

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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