Welcome Guest, Not a member yet? Register   Sign In
Using a model site-wide.
#1

[eluser]Mark Skilbeck[/eluser]
I have a model that I need to use site-wide, regardless of the controller I am currently using.

I'll explain a littler more: I have my files broken down into a global header file, then the content and then the global footer file. In the header file, I have a 'shout box', and this shout box uses a model to process the data and retrieve the data. Of course, I could just load the model in the constructor of my class.. but that seems a little messy. It would be better if I could load the model at the top-level and pass the data from the model to my shout box.

Question is is that possible?
#2

[eluser]xwero[/eluser]
There are two ways of doing this, with a module or autoloading your model.

The module i'm talking about is a controller method that is called in your header. You can use the wick library for this. because it's a controller method you have centralized everything to run the shoutbox which is a big maintenance plus.
#3

[eluser]Mark Skilbeck[/eluser]
Thank you, sir.




Theme © iAndrew 2016 - Forum software by © MyBB