Loading Data To Different Sections of Page

#1
[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

#2
[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>

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

J

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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