CodeIgniter Forums
New to CI & Fairly New to PHP. Trying to figure out the best Header/Nav/Content/Footer View Structure. - 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: New to CI & Fairly New to PHP. Trying to figure out the best Header/Nav/Content/Footer View Structure. (/showthread.php?tid=32039)



New to CI & Fairly New to PHP. Trying to figure out the best Header/Nav/Content/Footer View Structure. - El Forum - 07-11-2010

[eluser]Unknown[/eluser]
Hello!

I'm pretty new to CodeIgniter but I must say so far I'm very very impressed with what I've been capable of doing with very little effort. I'm learning CI & PHP mostly by going through Jeffery Way's Nettuts "CodeIgniter from Scratch" series.

Now that I've learned the basic concepts however, I've started working on building an actual site and I have a few questions about how I should structure everything.

Generally I setup an index.php page that is my site's basic structure. It holds all the skeleton HTML code, the linked css files, the meta data and so on and through a PHP include I add the header, the navigation, the content (say... aboutus.php), and the footer. I'll get a URL like http://www.DOMAIN.com/index.php?id=home.

What's the best way to do something like this in CodeIgniter? If my approach is totally not something that you would do with a CI/MVC approach, I'd be happy to hear any suggestions that you may offer me that would get me on the right track.

Thanks everyone for your help!

Michael Wesley Stratton


New to CI & Fairly New to PHP. Trying to figure out the best Header/Nav/Content/Footer View Structure. - El Forum - 07-12-2010

[eluser]flaky[/eluser]
try using this template library

http://williamsconcepts.com/ci/codeigniter/libraries/template/


New to CI & Fairly New to PHP. Trying to figure out the best Header/Nav/Content/Footer View Structure. - El Forum - 07-12-2010

[eluser]victorche[/eluser]
[quote author="flaky" date="1278951198"]try using this template library

http://williamsconcepts.com/ci/codeigniter/libraries/template/[/quote]
There is another simple template library here:

http://maestric.com/doc/php/codeigniter_template

I have no idea which one is better. For sure the first one looks more complex (which does not mean "better" automatically). Maybe someone can compare those two?