Top-posting, as I'm just seeing the thread now (I was travelling last
week and into Monday).

I actually call this out as a huge feature of ZF2. In ZF1, it was
difficult to do patterns like this cleanly. I would see hacks using
the Registry, but they always required weird setup and hard-to-trace
initializations that made it far easier to simply use forward() and
the ActionStack. With ZF2, because the view helpers are managed by a
plugin manager, we can do injections like you illustrate -- which make
doing widgets and blocks and whatnot trivial, and which make it quite
easy to keep the logic cleanly separated (why use a controller when
you simply need the model and view to communicate?).

So, yes, do this. Do it a lot! And _do_ allow your view helpers to
communicate with the layout by way of placeholders -- this is a great
way to include widget-specific CSS and/or JS, which likely is
module-specific.

On Sat, Jan 26, 2013 at 11:34 AM, Ralf Eggert <r.egg...@travello.de> wrote:
> Hi Marco,
>
>> Write operations and generally changes deriving from logic in views is
>> really to be avoided.
>
> Except, if these changes affect the view logic itself, like changing the
> layout script. That helps a lot for the discussion. :-)
>
> Regards,
>
> Ralf
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>



-- 
Matthew Weier O'Phinney
Project Lead            | matt...@zend.com
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to