ZF2 How to show module content in layout

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ZF2 How to show module content in layout

zf2usr
I want to generate a dynamic site using Zend_Layout.
(I'm using the standard ZF2 Skeleton by EvanDotPro)

I have many modules like  users, banner, news ...
I want to show all of it content in single layout.phtml (that contain application module)

layout.phtml:
<div id="usr_FORM">
   USER FORM
</div>

<div id="mnu_main">
   MAIN MENU
</div>

<div id="last_5_news">
   5 last NEWS
</div>

....


In ZF1 I use:
echo $this->action('index', 'util', 'util' );
But in ZF2 it doesn't work.
What is the right way to resolve this issue?


for example working code in ZF1:

layout.phtml
______________________
....
<div id="util_module">
   <?php  
              echo $this->action('index', 'util', 'util' );
     ?>
</div>

...
common content <?php echo $this->layout()->content ?>
....

______________________