Welcome Guest, Not a member yet? Register   Sign In
Where is the best place to put this bit of code...
#1

[eluser]sanchothefat[/eluser]
Hi, I've only just started hacking around with CI. I'm not too hot on php but I get OO programming and how to use classes/methods and so on. What I'm trying to figure out how best to organise my code for a simple application I'm writing as part of a site.

My question is, say you have a section of the web page that you want on all pages of the site, but that bit has some dynamic data in it. How do you include that data across multiple controllers?

To put it in context on the site i'm working on there is a list of gig dates down the side. These are parsed from an iCal feed in my default controller. Should I create a public method to collect the data and call it in each controller and then just include the appropriate sub-view in the controller's main view file? If so where/how would you define that method?

Hopefully that makes some sense...

Cheers


Messages In This Thread
Where is the best place to put this bit of code... - by El Forum - 03-13-2008, 07:01 AM
Where is the best place to put this bit of code... - by El Forum - 03-13-2008, 08:10 AM
Where is the best place to put this bit of code... - by El Forum - 03-13-2008, 04:38 PM
Where is the best place to put this bit of code... - by El Forum - 03-13-2008, 05:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB