Welcome Guest, Not a member yet? Register   Sign In
Information you use on every page
#1

[eluser]Unknown[/eluser]
Hello,

I have seperated my layout in header content and footer. Header and footer i include on the pages.

In the footer i have some text that comes out of the DB, is there a easy wat of getting the info from the database there? Offcoure i can load the model and get the text on every page, but isnt there a easier way?

Weccop
#2

[eluser]Madmartigan1[/eluser]
To the best of my limited knowledge, no. It seems auto-loading the model is the best/only way without using any additional libraries or compromising the MVC structure.

It's boggling to me how difficult this is in CI.

I've been trying to figure out the right way to do this myself. Hopefully someone can come up with a GOOD answer.
#3

[eluser]mattpointblank[/eluser]
I could do with a smart solution for this too. I posted about it before, but basically a lot of my views that I use in every page (headers, footers, etc) have dynamic information (latest comments / articles, etc) and each of my controllers has to load 4/5 views and several models and run several queries before I can display a simple page.
#4

[eluser]jedd[/eluser]
Hi Weccop and welcome to the CI forums.

You may be interested to know we have a CI FAQ too.

The question you've posted, unsurprisingly, comes up every 36-48 hours (average).

Have a read of [url="http://codeigniter.com/wiki/FAQ"]this page[/url] in the FAQ, follow the links, and read them too. Get back to us if your question isn't answered by the FAQ.




Theme © iAndrew 2016 - Forum software by © MyBB