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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.