[eluser]Bigil Michael[/eluser]
I want to pass some data in all methods of demo controller. So i created a function in constructor and load that data in that function. please refer the below example
Code:
<?php
class Demo extends CI_Controller{
function demo(){
parent::__construct();
//
$this->get_common();
}
function add(){
.
.
$this->load->view('view name', $data);
}
function edit() {
.
.
.
$this->load->view('view name', $data);
}
....
..
..
function get_common(){
$data['test'] = "Some text message";
}
}
It is not working.
Code:
If I replace $data with $this->data , it works fine.
can any one solve this issue??