[eluser]behnampmdg3[/eluser]
Hello friends;
I am very new to CI. I am sure there is a "right way" to do this that I don't know of:
I have multiple functions in my controller and each of them send different values to view.
I was wondering how I can send values from different functions of a controller to a view which already has been loaded "WITHOUT RELOADING IT". In other words, I do not want to load a view multiple times, I just want to load it once, and further send values to it from different functions.
Thanks
For example:
Code:
public function __construct()
{
//Load header
$page_info['title'] = "Members";
$this->load->view('header_view', $page_info);
}
public function show_members()
{
//Load view and send member's info
$this->load->model('members_model');
$data = $this->members_model->search();
$m['members'] = $data;
$this->load->view('members_view', $m)
}
public function show_bookings()
{
//Load view and send bookins's info
$this->load->model('bookings_model');
$data = $this->bookings_model->search();
$b['members'] = $data;
$this->load->view('members_view', $b) //But as you see here, the view has already been loaded. I dont want to re-load it, I just want to send data to it.
}