Hackwar/joomla-platform — comment on commit 5532ba526ed336682889918672c3d94c752d9f9f
File:  line 0
By WebMechanic:

I managed to give the plugin/event part a shot and I must say: I'm utterly pleased! :-)
I like plugins and I like to get access to the various objects involved in rendering the final page (like Zend allows me to to).
This "braindead" simple patch gives plugins access to various "runtime" properties to tweak them "way long" before the whole stuff gets near the template and layout files, let alone the browser/client.
And I'm only talking about **HTML** output here. I'm still due to see what I can screw up in a Plugin for my JSON views...B-)

For the HTML (incl. the CMS), it'd save me a some of my usual templating overide Kung-fu, if()ing around params. Now they're available *early on* to be tweak, sanitized, what-now to do things in behind, I'd otherwise need to throw in yet another override, or menu item. And since it happens in a Plugin I can enable or disable those "features" or set the access level. If only to test the stuff before it's rolled out to the public.

**Love it! And will keep it nonetheless!** It's not the only "custom event" I use in the CMS for years, let alone my own stuff. And now I only need to call `parent::display()` and my component get's it's very own plugin group for free :-)
Thanks for the head up, Hannes! Simple ideas are often the best!

There are parts of it (in `display()`) I'd change regarding the defaults (why 'content'?) and I can't see where `$results` would come into play or be of any useful after the dispatcher returns.

I'm not as much of a fan ofr the 2nd part in `loadTemplate()`. This looks kinda "hackish" and makes the override logic more complicated as it adds even more possible locations into the mix. I might argue it will have have a slight impact on performance as well.
I don't even think it's needed 'cos a Plugin, now given access to the `$view` itself, could change "or fake" the very same properties and force `loadTemplate()` to do the same w/o being touched. I could be wrong though, 'cos it just seems so complicated that I didn't bother yet to give it a try :-)

Prost! Und nochmals Danke für das "Ereignis" :D