Module Query |
[eluser]Funky Fresh[/eluser]
Hey Hey, I am new to CI and im writing my first membership based site. I have the general website at the front with 'Home | About us | Blog | Contact' etc etc ... on each of these pages i want to have a login box. I use a different controller for each page ... i know how to insert a different view onto the page templates i.e insert the login box view onto the about us page etc etc But that means i have to copy the same data in the controller over to each of the other front page controllers .... Is there a way i can include a controller in another controller or something like that? Could someone give me some advice how they would tackle this. Cheers,
[eluser]danmontgomery[/eluser]
Create a base class (or extend the controller library) and extend your controllers from there. http://php.net/manual/en/language.oop5.inheritance.php
[eluser]Funky Fresh[/eluser]
I found this article on the WIKI http://codeigniter.com/wiki/Header_and_F...ge_-_jedd/ Would that be what im looking for? |
Welcome Guest, Not a member yet? Register Sign In |