PHPackages                             petebrowne/slim-layout-view - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. petebrowne/slim-layout-view

ActiveLibrary[Templating &amp; Views](/categories/templating)

petebrowne/slim-layout-view
===========================

A Custom View supporting Layouts for the Slim Framework.

0.3.0(12y ago)3518.0k4[2 issues](https://github.com/petebrowne/slim-layout-view/issues)MITPHPPHP &gt;= 5.3.0CI failing

Since Dec 29Pushed 12y ago5 watchersCompare

[ Source](https://github.com/petebrowne/slim-layout-view)[ Packagist](https://packagist.org/packages/petebrowne/slim-layout-view)[ Docs](http://petebrowne.com)[ RSS](/packages/petebrowne-slim-layout-view/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

slim-layout-view
================

[](#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.

Installation
------------

[](#installation)

Add `"petebrowne/slim-layout-view"` to your `composer.json` file:

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

And install using composer:

```
$ php composer.phar install
```

Configuration
-------------

[](#configuration)

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

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

Usage
-----

[](#usage)

Now create your layout file. The content from the rendered view will be in a variable called `$yield`:

```

```

Now you can render the view in the usual way:

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

Rendering with custom layouts or without any layout at all is also supported:

```
// 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
---------

[](#copyright)

Copyright (c) 2013 [Peter Browne](http://petebrowne.com). See LICENSE for details.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~112 days

Total

4

Last Release

4549d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cf7797ccc706ce9a5e239aa0ab0b10056b55140493caf12190b733473962d76?d=identicon)[petebrowne](/maintainers/petebrowne)

---

Top Contributors

[![petebrowne](https://avatars.githubusercontent.com/u/23861?v=4)](https://github.com/petebrowne "petebrowne (6 commits)")[![alizaheer](https://avatars.githubusercontent.com/u/1940593?v=4)](https://github.com/alizaheer "alizaheer (3 commits)")[![t1mmen](https://avatars.githubusercontent.com/u/192263?v=4)](https://github.com/t1mmen "t1mmen (1 commits)")

---

Tags

slimviewlayout

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/petebrowne-slim-layout-view/health.svg)

```
[![Health](https://phpackages.com/badges/petebrowne-slim-layout-view/health.svg)](https://phpackages.com/packages/petebrowne-slim-layout-view)
```

###  Alternatives

[entomb/slim-json-api

Slim extension to implement fast JSON API's

268156.4k4](/packages/entomb-slim-json-api)[dogancelik/slim-json

JSON middleware for Slim PHP framework

3984.0k3](/packages/dogancelik-slim-json)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
