site inside enclosing html - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: site inside enclosing html (/showthread.php?tid=38553) |
site inside enclosing html - El Forum - 02-11-2011 [eluser]Unknown[/eluser] Hi. I was wondering, is there a way to place down a markup on every page, regardless of the controller, and than load the views inside that? So, for example I can create a wrapper div for my site, and than load the necessairy views inside that. site inside enclosing html - El Forum - 02-11-2011 [eluser]Pedro Luz[/eluser] i dont know if i did understand want you want but you can use a kind of template Code: // the view that you want to load in the view, the /tpl/template_base.php Code: <div class="main-content"> and you can do this for has many views as you want just pass Code: $data['navigation'] = 'views/navigation'; this way you can send multiple views to the template site inside enclosing html - El Forum - 02-11-2011 [eluser]Unknown[/eluser] Is it concidered bad practice to do this using hooks? so for example to make a pre_controller hook that displays something like "<html><div id='wrapper'>"; and a post_controler that displays "</div></html>"? p.s. yes, I know there should also be head and body tags, this was just an example. |