Welcome Guest, Not a member yet? Register   Sign In
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.




Theme © iAndrew 2016 - Forum software by © MyBB