[eluser]jplanet[/eluser]
I need to create some modules for an ecommerce application, such as "Welcome username!" and "Cart: 3 Items", which will appear on every page throughout the website.
these items require a query to obtain the data to display, code to assign the results to a variable in CI's $data array, and a small view file to display it.
Going the traditional Codeigniter route, this would involve adding code to every single Controller function. This seems counter-intuitive and error-prone.
Is there a way, in the Codeigniter architecture, to have a component which contains all database, logic, as well as display code? I'm thinking of someting I can simply include in as a view 'part', but that contains all of the code necessary to display.
I am almost tempted to just write a traditional PHP script to include, but I need to access CI's session functions for the above mentioned functionality.
Any help is greatly appreciated!