CodeIgniter Forums
Loading Data To Different Sections of Page - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Loading Data To Different Sections of Page (/thread-28698.html)



Loading Data To Different Sections of Page - El Forum - 03-18-2010

[eluser]jasongodoy[/eluser]
Hello all!

Trying to do:
Display different sets of data (same model different functions) on 1 view.

Stumped on:
In my controller, how do I specify two calls for different data and display that data in the same view (say one set of in left column and the other set in the right column of a two column table)?

Thanks for the newbie help! :down:

J


Loading Data To Different Sections of Page - El Forum - 03-18-2010

[eluser]foyer[/eluser]
You mean something like this?

Code:
$this->load->model('mymodel');

$data['left'] = $this->mymodel->left();
$data['right'] = $this->mymodel->right();

$this->load->view('view', $data);

<div id="left">&lt;?=$left?&gt;</div>
<div id="right">&lt;?=$right?&gt;</div>


Loading Data To Different Sections of Page - El Forum - 03-18-2010

[eluser]jasongodoy[/eluser]
Thank you so much foyer. Everything worked perfectly! I appreciate your help.

J


Loading Data To Different Sections of Page - El Forum - 03-19-2010

[eluser]Zeeshan Rasool[/eluser]
You can also use parser helper to parse these partials in your main view.