Closed patrickmj closed 8 years ago
I'd say the direct call is better. In the normal flow for something like the logger, you'll never use it (as it's only for errors). If you just have "direct" calls, that means we never have to actually create the plugin and inject the logger (or might not even have to create the logger itself, if nothing's ever logged in that request).
The performance difference is absurdly minor so it really doesn't make much of a difference but that's the general intent with the controller plugins.
For example the logger helper gets set as a property. Dunno if it's better to just do a direct call like
or keep it as
in the constructor and call on that property when desired.