Welcome Guest, Not a member yet? Register   Sign In
Message: Undefined variable: data
#1

[eluser]solid9[/eluser]
All I just want is to declare the $data as public and as an array variable.
So that I can access it in every function of the class.
But it failed.

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$data = array();

class Main extends CI_Controller {

public function __construct() {
  parent::__construct();

  $this->load->helper('form');
  $this->load->helper('html');
  $this->load->helper('url');    
  $this->load->library('ion_auth');
  $this->load->library('session');
  $this->load->library('form_validation');
  $this->load->database();

  //$this->load->model('prod_m');
}


function login()
{
  $this->$data['header'] = $this->load->view('header', null, TRUE);
  
  $this->load->view('front_page', $this->data);
}

}
/* End of file main.php */
/* Location: ./application/controllers/main.php */

any help please.

Thanks in advanced


Messages In This Thread
Message: Undefined variable: data - by El Forum - 01-22-2012, 11:14 PM
Message: Undefined variable: data - by El Forum - 01-22-2012, 11:55 PM
Message: Undefined variable: data - by El Forum - 01-23-2012, 01:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB