Welcome Guest, Not a member yet? Register   Sign In
Passing data to views called from another view
#9

[eluser]achilleusrage[/eluser]
Sorry if I'm misunderstanding but I think you will want to select the data for your menu in your controller. Then pass it to your view in the $data var. In looking at your original sample code, you would do something like this:

Code:
function page2($page) {
  $data['page_title'] = 'Your title for content 2';

$data['news'] = $this->news_model->get_news($page);

$data['menu'] = $this->some_function_that_returns_menu_data($page);
  
  $this->load->view('container',$data);
}


Messages In This Thread
Passing data to views called from another view - by El Forum - 03-06-2012, 07:28 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 07:41 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 07:56 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 08:10 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 11:06 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 11:17 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 01:16 PM
Passing data to views called from another view - by El Forum - 03-07-2012, 05:01 AM
Passing data to views called from another view - by El Forum - 03-07-2012, 05:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB