Welcome Guest, Not a member yet? Register   Sign In
Undefined property: CI::$data
#1

[eluser]whygod[/eluser]
I'm using PHP ver. 5.5.9

And these are the codes in the controller,
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends MX_Controller
{


    function __construct ()
    {
        parent::__construct();
        
  $this->data['message'] = '';
  $this->data['title'] = 'AdminS9 Control Panel';
  
        $this->load->model('users_model');
    }

    function index(){
  $this->data['password_header'] = $this->load->view('password_header', $this->data, TRUE);
  $this->load->view('password', $this->data);  
    }

}

Thanks in advance who ever will help me.
#2

[eluser]whygod[/eluser]
Okay problem solved.

I just forgot to declare the $data.

<code>
&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends MX_Controller
{
public $data;

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

$this->data['message'] = '';
$this->data['title'] = 'AdminS9 Control Panel';

$this->load->model('users_model');
}

function index(){
$this->data['password_header'] = $this->load->view('password_header', $this->data, TRUE);
$this->load->view('password', $this->data);
}

</code>
#3

[eluser]whygod[/eluser]
Although I already solved this problem.
the next problem is it won't display anything.
the whole page is blank.




Theme © iAndrew 2016 - Forum software by © MyBB