Hello Roman

I have asked myself the same question: How can I pass basic, standard
variables to the View that should be available on every section of the
module. I your case, you just want the names of controller and action
in the View. I also want some more standard variables (locale, uri
etc).

I have come up with a solution that involves a custom
\Zend\Mvc\Controller\ActionController that is then used by the
Controllers.

Please take a look at this solution:

https://gist.github.com/2792133

I am looking at your solution right now.

What are the advantages of these two approaches?

Jonathan Maron



On Thu, May 10, 2012 at 7:43 PM, cmple <roman.vidya...@gmail.com> wrote:
> Hi,
>
> How can I access the controller's name and action in the layout in ZF2?
>
> Thanks!
>
> --
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/ZF2-Access-controller-name-action-from-layout-tp4624104.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>

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


Reply via email to