Jump to content

Undefined variable? Basic mistake... ~sigh~


ask9

Recommended Posts

:'(

 

Still forgetting it.

 

<?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 */

 

All I just is to make the $data array variable as public and works across all function inside the class.

Where did I made wrong?

 

Thanks in advance.

 

 

Link to comment
https://forums.phpfreaks.com/topic/255572-undefined-variable-basic-mistake-~sigh~/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.