CodeIgniter Forums

Full Version: Loading Data To Different Sections of Page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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

El Forum

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

El Forum

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

J

El Forum

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