Using a model site-wide.

[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?

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.

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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.