Footer problem??? |
[eluser]skeletonfriend[/eluser]
Hi, First of all, I'm new to CI. I'm developing a site where I separate header, content, and footer into separate views. Everything works fine until ran into this problem....I have built an model for the footer, in which I want to present some statistics in. I could call the model in every contentpage controller, but that would be to repeat myself with the same code over and over. Is there anyway to call my footer-model from an global controller? I would appreciate some help! Thanks
[eluser]gunter[/eluser]
you could use a display_override hook.... or you echo your footer with a post_system hook... http://ellislab.com/codeigniter/user-gui...hooks.html but you need something to generate the data... hm... then you could use a basecontroller... search for extending controllers or my_controller or something... it works like this: save a controller like this: Code: class Welcome_original extends Controller { and safe another controller like this: Code: include ('base_controller.php'); if I remember correctly, you can save the basecontroller as my_controller (where? in the library folder? I donĀ“t know... try it...) and then it gets automatically included and you only have to write xxx extends my_controller... okay? ;-) |
Welcome Guest, Not a member yet? Register Sign In |