Amy,
Ofer did not ask for a way to override a core view, but a simple and
reliable way to change the chosen layout. There are several reasons why
I wouldn't want to override a complete view, starting with the need to
update my overriden view when the original view is updated. What are you
going to do if you have different extensions that want to override the
same view?
Regardless of that, the code that I proposed allows for A LOT more than
just "overriding" a view. And even though I agree with the notion that
the MVC most likely needs to be revamped, I first have to see the code
before I stop bugging everyone with these small improvements. The
changes to JView were ready in time for Joomla 1.7 and thus could
already be used by lots of people for at least 2 major releases. There
isn't a lot more than good intentions regarding a new MVC as far as I
know. And even if there were, that still leaves a few thousand legacy
extensions out there using the old code. So as long as we are talking
about varporware, please don't dismiss my code as "obsolete soon anyway".
Hannes
Am 21.03.2012 15:57, schrieb Amy Stephen:
> Ofer -
> In a system plugin, you can pretty much override any core view -- or,
> better yet, extend it. Then, you can override the layout as you wish.
> Hannes -
> To be fair, I didn't see the benefit of your approach, either. If a
> developer has to create a plugin to change the layout (as was the case
> with your solution) -- then, really, that's doable today by extending
> or overriding the view at runtime. I honestly don't believe anyone is
> singling out your code to reject it but rather that there is broad
> acceptance now that the entire MVC needs rethinking.
> There are many ways to override, extend the MVC today - it's not that
> big of a deal although this approach limits who can do it (you must
> have development skill and awareness of the J! API). That is not going
> to help the frontend dev who most likely isn't a strong PHP coder.
> Moving towards a parameter driven layout and shared layouts (or REAL
> views) in the future will be much better.
> On Wednesday, March 21, 2012 6:28:10 AM UTC-5, oc666 wrote:
> Hey All
> Is there any way that I can override layout of view from plugin?
> Thanks
> --
> Ofer Cohen
> TP2 <http://extensions.joomla.org/extensions/style-a-design/modules-manage...> - The new way to manage your modules
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/joomla-dev-general/-/_lf6hgcXaKoJ.
> To post to this group, send an email to
> joomla-dev-general@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-general+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-general?hl=en-GB.