Zend Framework 2: layouts per module and action

You are here

The talented Evan Coury created a module that allows you to specify alternative layouts to use for each module.
I forked Evan's module and extended it to allow layouts per action as well as per module. This way if one of your controller actions needs a different layout for example a large table, you can set a different layout template for it.

returnarray('controllers'=>array('invokables'=>array('Album\Controller\Album'=>'Album\Controller\AlbumController',),),// The following section is new and should be added to your file'router'=>array('routes'=>array('album'=>array('type'=>'segment','options'=>array('route'=>'/album[/:action][/:id]','constraints'=>array('action'=>'[a-zA-Z][a-zA-Z0-9_-]*','id'=>'[0-9]+',),'defaults'=>array('controller'=>'Album\Controller\Album','action'=>'index',),),),),),