Welcome Guest, Not a member yet? Register   Sign In
Loading dynamic content into blockviews
#2

[eluser]oppenheimer[/eluser]
Have you thought about using the third parameter of the $this->load->view to load each block into a variable?

Code:
$page['header'] = $this->load->view('header',$data,true);
$page['adblock'] = $this->load->view('adblock',$data,true);
$page['sidebar'] = $this->load->view('sidebar',$data,true);

You can load $data with any information from the DB that you want that view to display.

Then you need an overall view that pulls it all together and displays it.
Code:
$this->load->view('layout',$page);
In this 'layout' view, you can do the following at the appropriate place:
Code:
<?php
if (isset($header)) echo $header;
if (isset($adblock)) echo $adblock;
if (isset($sidebar)) echo $sidebar;
?>


Messages In This Thread
Loading dynamic content into blockviews - by El Forum - 04-10-2011, 07:49 AM
Loading dynamic content into blockviews - by El Forum - 04-10-2011, 08:32 AM
Loading dynamic content into blockviews - by El Forum - 04-10-2011, 09:54 AM
Loading dynamic content into blockviews - by El Forum - 04-10-2011, 10:05 AM
Loading dynamic content into blockviews - by El Forum - 04-10-2011, 10:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB