Welcome Guest, Not a member yet? Register   Sign In
When to use a library within the view (maybe?)
#1

[eluser]c77m[/eluser]
I know in an ideal world libraries would not be used inside a view. However, it is also ideal not to have redundant code all over the place, too. So what is the best answer to this conundrum?

I have database-driven data that needs to be loaded on <b>EVERY</b> page in the site, regardless of controller and method. It is in a portion of a sidebar view, which is loaded on each page.

Instead of loading the data in every single controller and passing it to the view, would this not be a good example of when you <i>should</i> access a library inside the view? I'm looking for pros and cons with a focus on code efficiency.


Messages In This Thread
When to use a library within the view (maybe?) - by El Forum - 04-20-2011, 11:24 AM
When to use a library within the view (maybe?) - by El Forum - 04-20-2011, 12:05 PM
When to use a library within the view (maybe?) - by El Forum - 04-20-2011, 03:32 PM
When to use a library within the view (maybe?) - by El Forum - 04-20-2011, 04:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB