2017 © Pedro Peláez
 

library zf2-route-layout-module

Simple ZF2 Module that switches layouts based on arrays of layout names and route names

image

netglue/zf2-route-layout-module

Simple ZF2 Module that switches layouts based on arrays of layout names and route names

  • Wednesday, May 29, 2013
  • by netglue
  • Repository
  • 0 Watchers
  • 0 Stars
  • 90 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Switch Layout Based on Matched Route Name

Introduction

This is a simple module to switch layout based on the currently matched route name, (*1)

Installation

The module should be installed with composer. It's name is netglue/zf2-route-layout-module If you have problems installing with composer, check your minimum-stability setting., (*2)

Enable the module in your main config file. The module name you should enter is NetglueRouteLayout, (*3)

Look in the vendor/netglue/zf2-route-layout-module directory once installed and look at the config files to see what can be altered for your app., (*4)

Configuration

By default, the module does nothing as there are no configured routes or layouts., (*5)

To specify route/layout changes provide config in the following way:, (*6)

//...

'netglue_route_layout' => array(

    'by_route' => array(
        'my/route-name' => 'a-different-layout',
    ),

    'by_layout' => array(
        'a-different-layout' => array(
            'my/route-name',
            'my/other-route-name',
        ),
    ),

),

//...

Services

There is one service available from the service manager which is an instance of NetglueRouteLayout\Service\RouteLayout take a look in the /src dir... it's very simple., (*7)

// Add a route manually
$instance = $serviceLocator->get('NetglueRouteLayout\Service\RouteLayout');
$instance->addRoute('my/route-name', 'a-different-layout');
// Or
$instance->addRoutesByLayout('new-layout', array(
    'my/route-name',
    'my/other-route-name'));
// Find out which layout a particular route has. Returns null if no specific layout has been configured
$layout = $instance->getLayout('my/route-name');

The Versions

29/05 2013

dev-master

9999999-dev https://github.com/netglue/zf2-route-layout-module

Simple ZF2 Module that switches layouts based on arrays of layout names and route names

  Sources   Download

MIT

The Requires

 

zf2 zend module encryption netglue

29/05 2013

0.1.0

0.1.0.0 https://github.com/netglue/zf2-route-layout-module

Simple ZF2 Module that switches layouts based on arrays of layout names and route names

  Sources   Download

MIT

The Requires

 

zf2 zend module encryption netglue