2017 © Pedro Peláez
 

library slim-layout-view

A Custom View supporting Layouts for the Slim Framework.

image

petebrowne/slim-layout-view

A Custom View supporting Layouts for the Slim Framework.

  • Saturday, December 14, 2013
  • by petebrowne
  • Repository
  • 5 Watchers
  • 35 Stars
  • 8,458 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 2 Open issues
  • 5 Versions
  • 2 % Grown

The README.md

slim-layout-view

A Custom View supporting Layouts for the Slim Framework. slim-layout-view requires Slim 2.0+, which now follows the PSR-2 standard., (*1)

Installation

Add "petebrowne/slim-layout-view" to your composer.json file:, (*2)

``` json { "require": { "slim/slim": "2.", "petebrowne/slim-layout-view": "0.3." } }, (*3)


And install using composer: ``` bash $ php composer.phar install

Configuration

Configure Slim to use slim-layout-view, and optionally set the layout file to use (defaults to 'layout.php'):, (*4)

``` php $app = new \Slim\Slim(array( 'view' => '\Slim\LayoutView', 'layout' => 'layouts/main.php' ));, (*5)


Usage ----- Now create your layout file. The content from the rendered view will be in a variable called `$yield`: ``` html+php <html> <head></head> <body> <?php echo $yield ?> </body> </html>

Now you can render the view in the usual way:, (*6)

``` php $app->get('/', function() use ($app) { $app->render('index.php'); });, (*7)


Rendering with custom layouts or without any layout at all is also supported: ``` php // Use a different layout for this route: $app->get('/', function() use ($app) { $app->render('index.php', array('layout' => 'custom_layout.php')); }); // Skip the layout for this route: $app->get('/index.xml', function() use ($app) { $app->render('xml.php', array('layout' => false)); });

Copyright (c) 2013 Peter Browne. See LICENSE for details., (*8)

The Versions

14/12 2013

dev-master

9999999-dev http://petebrowne.com

A Custom View supporting Layouts for the Slim Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

slim view layout

03/12 2013

0.3.0

0.3.0.0 http://petebrowne.com

A Custom View supporting Layouts for the Slim Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

slim view layout

26/09 2013

0.2.1

0.2.1.0 http://petebrowne.com

A Custom View supporting Layouts for the Slim Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

slim view layout

05/09 2013

0.2.0

0.2.0.0 http://petebrowne.com

A Custom View supporting Layouts for the Slim Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

slim view layout

29/12 2012

0.1.0

0.1.0.0 http://petebrowne.com

A Custom View supporting Layouts for the Slim Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

slim view layout