• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing child views an array

#1
[eluser]Unknown[/eluser]
Hi there, newbie here,
I am loading a View in, in that view I'm loading 2 partial views, they require an array each, I can pass either one of them an array, just by passing it to the parent, but not both. What's the best way?
Thanks, Phil

#2
[eluser]danmontgomery[/eluser]
Code:
$data = array(
    'child_view_1' => $this->load->view('child_view_1', $array_1, TRUE),
    'child_view_2' => $this->load->view('child_view_2', $array_2, TRUE)
);
$this->load->view('parent_view', $data);

#3
[eluser]Unknown[/eluser]
Perfect thanks.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.