Welcome Guest, Not a member yet? Register   Sign In
CSS setup
#1

[eluser]bndk[/eluser]
Good day,

I'm trying to develop a website with the CI framework for the first time.

I have a question regarding CSS setup, and how people usually deal with the header, main window, footer aspect when developing sites with CI.

For obvious reasons I want my header, main menu etc. to stay the same across the entire website and only letting the main window (content) change when users browse the site.

To do this I was thinking of having several views (header.php, footer.php etc.) and load them in every controller.
Is this common or bad practice?

Thanks!
#2

[eluser]Noobigniter[/eluser]
Hello also!

If you wish, you can take a look at this thread: Template library - Any suggestions?

Smile

#3

[eluser]InsiteFX[/eluser]
You can load your views in a template view, this way you only need to load your main template view.

template.php
Code:
<?php $this->load->view('header); ?>

// you can also use variables here for content that changes.
<?php $this->load->view(''content); ?>

<?php $this->load->view('footer); ?>




Theme © iAndrew 2016 - Forum software by © MyBB