Loading a model automatically on all pages? |
[eluser]Mischievous[/eluser]
I am creating a shopping cart/cms with codeigniter and I am curious on how I could go about loading up a mini-cart that will be show on all pages through the sites that shows the number of items in a cart as well as the total of the cost of the current items in the cart (ex: 2 Items ($123.97))... I don't need help on having this information display... just curious as a quick way to load a model throughout the entire system to have it generate the needed information? Something like an autoload model but i would need the function to run to inject the information into the template? Without having to place this on every function in the controllers to run???
[eluser]wowdezign[/eluser]
You can extend the Model class to have methods you want to use throughout the site. You can read up on it under Extending Core Class at: http://ellislab.com/codeigniter/user-gui...asses.html
[eluser]Mischievous[/eluser]
Could I setup a hook to essentially do the same duty? |
Welcome Guest, Not a member yet? Register Sign In |