Welcome Guest, Not a member yet? Register   Sign In
code duplication advice
#12

[eluser]rootman[/eluser]
The problem about your approach jwindhorst is imho that you have to call the function every time you want to create output and you got to pass the header/footer data every single time. This is excactly what I want to avoid.

My structure is like this: I have a view and i include the header and the footer inside of the view. This way i have full control over my output inside of my views and the designer can even integrate different headers without touching the controller. I dont want to create complicated constructs to load different views with different data for each one, I wanna keep it simple Smile Just make some variables globally availiable in all views, as if I passed them. Maybe there is a way to pass global variables in advance and just let them "hang" there, no matter if used or not.

Sure i could write a helper that pulls in the desired variables, but I believe that to be over the top, shouldnt it be simple just to tell the output class to have some more vars availiable? I dont want the designer to notice that there is something even going on different from the normal approach ... Wink


Messages In This Thread
code duplication advice - by El Forum - 03-24-2009, 08:39 PM
code duplication advice - by El Forum - 03-24-2009, 08:53 PM
code duplication advice - by El Forum - 03-24-2009, 09:24 PM
code duplication advice - by El Forum - 03-26-2009, 03:07 AM
code duplication advice - by El Forum - 03-26-2009, 05:11 AM
code duplication advice - by El Forum - 03-26-2009, 12:26 PM
code duplication advice - by El Forum - 03-26-2009, 06:37 PM
code duplication advice - by El Forum - 09-30-2009, 02:31 PM
code duplication advice - by El Forum - 09-30-2009, 02:44 PM
code duplication advice - by El Forum - 09-30-2009, 02:49 PM
code duplication advice - by El Forum - 09-30-2009, 02:59 PM
code duplication advice - by El Forum - 09-30-2009, 03:34 PM
code duplication advice - by El Forum - 01-10-2010, 06:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB