[eluser]bl00dshooter[/eluser]
[quote author="peturkirke" date="1293848556"]Hello, i have just started with OOP and CodeIgnitor.
Before OOP, when i created a template, i was using the include function, so i could keep some contents in every page, for example the header block and the footer.
I can see, in CodeIgnitor and OOP this is done different.
So far i have put these commands in every function i made in the controller:
$this->load->view('top');
$this->load->view('footer');
but i dont like to repeat this every time for every function, it doesnt seem right to me.
What is the correct set up for this task ?[/quote]
Have you tried loading the top view on the __construct function and the footer on the __destruct function? You could also extend the Loader library to load these views by default. Or maybe you could use an alternative solution to CI's.
Many ways to achieve want you want...