Welcome Guest, Not a member yet? Register   Sign In
Loading Helpers and Libraries in the constructor vs index
#1

[eluser]Jim Higgins[/eluser]
Is there any advantages or disadvantages to loading a helper and/or library in the constructor versus the index function of the class? ... assuming you only have an index function and the library/helper does not need to be accessed by many functions.
#2

[eluser]Tom Glover[/eluser]
If you are using the lib once in a controller then load it in the index or other function, but if you are going to use it multiple time then load it in the constructor, or auto load the lib in the config.




Theme © iAndrew 2016 - Forum software by © MyBB