![]() |
Template (kind off) - 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: Template (kind off) (/showthread.php?tid=55894) |
Template (kind off) - El Forum - 11-15-2012 [eluser]jurlan[/eluser] Hi all, I was wondering what's the best way to only load {header}, {menu} and {footer} only once throughout the application and just dynamically change the {content} according to the link being clicked? Thanks in advance /jurgen Template (kind off) - El Forum - 11-15-2012 [eluser]noslen1[/eluser] You should have a main router view named /views/index.php with a body like this : Code: <body> that you call in all of your controllers functions, and you dynamically pass your content template to load into the view : Code: $data->content = 'page/content'; Template (kind off) - El Forum - 11-15-2012 [eluser]jurlan[/eluser] Thanks a lot! I've seen al kinds of solutions while googling, but this one definitely seems the best and easiest out there. Thank you ;-) /jurgen |