CodeIgniter Forums
How i use masterpages in CI 2.0? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: How i use masterpages in CI 2.0? (/showthread.php?tid=39548)



How i use masterpages in CI 2.0? - El Forum - 03-14-2011

[eluser]thomas_86[/eluser]
Hello,

iam new with CI. I coded a litte news-controller to submit and view some news ... such to get familiar with CI. All works fine ... the next step (for me) is to include the news-controller in a masterpage. Masterpage constist maybe of navigation, header, footer and of course a content area. Also if the news-controller is active, there shows some additional navigation-items ... like archive or so

So how i realize that? There some nice tutorials?

greets
soyo


How i use masterpages in CI 2.0? - El Forum - 03-15-2011

[eluser]thomas_86[/eluser]
Good Morning,

i used a lot of google and found 2 solutions for my problem.

1. - extend from MY_controller, which contain for e.g. the header, content and footer view

2. - nested views

which one is better?

Greets
soyo


How i use masterpages in CI 2.0? - El Forum - 03-15-2011

[eluser]raenk[/eluser]
Hi,

You should create the controller extending CI_Controller and take a look at this: http://www.youtube.com/watch?v=gvGymDhY49E

Cheers