Welcome Guest, Not a member yet? Register   Sign In
mvc all in one file
#1

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


Messages In This Thread
mvc all in one file - by El Forum - 03-24-2008, 12:50 PM
mvc all in one file - by El Forum - 03-24-2008, 01:43 PM
mvc all in one file - by El Forum - 03-24-2008, 01:50 PM
mvc all in one file - by El Forum - 03-24-2008, 01:59 PM
mvc all in one file - by El Forum - 03-24-2008, 02:14 PM
mvc all in one file - by El Forum - 03-24-2008, 02:15 PM
mvc all in one file - by El Forum - 03-24-2008, 04:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB