Friday, 7 November 2014

How to call a layout in Controller in Zendframework2

Zend Framework 2

-:: Step 1 ::-
Create layout file
========================================================================
First Create a directory in your module,
Suppose we have User module, and I would like to add login page layout
then, create module/User/view/layout/login.phtml file into this directory
========================================================================



-:: Step 2 ::-
Call layout into your Controller Action
========================================================================
Simply Call the layout this way into 

your controller

$this->layout('layout/login');

========================================================================

No comments:

Post a Comment