• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
When to $this->load

#1
[eluser]davlyn[/eluser]
Performance wise, and general good practice wise when it is recommended to load a certain helper or lib?

Or in other words when should load in:

1. Auto load?
2. Controller level so that every method can access it?
3. Method/Function?

Same could be asked for models also.


#2
[eluser]Otemu[/eluser]
1. If you commonly use the helper/lib or model throughout your site then autoload it
2. If you commonly use the helper/lib or model in every function of that controller then load it at controller level
3. If it not commonly used in other method/functions then load it at this level

In terms of benchmarking I am not sure how much diff it makes, could be talking milliseconds.

#3
[eluser]davlyn[/eluser]
Thanks, that mases sense.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.