PHPackages                             desmart/laravel-layout - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. desmart/laravel-layout

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

desmart/laravel-layout
======================

Simple page structure controller for Laravel4

1.2.0(11y ago)12613[2 issues](https://github.com/DeSmart/laravel-layout/issues)PHPPHP &gt;=5.4.0

Since May 16Pushed 10y ago13 watchersCompare

[ Source](https://github.com/DeSmart/laravel-layout)[ Packagist](https://packagist.org/packages/desmart/laravel-layout)[ RSS](/packages/desmart-laravel-layout/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (13)Used By (0)

[![Build Status](https://camo.githubusercontent.com/7e1b12a7f960949435e1adbd642ec118c100f4fe1655c8827cbf8b7c2a540223/68747470733a2f2f6170692e7472617669732d63692e6f72672f4465536d6172742f6c61726176656c2d6c61796f75742e706e67)](https://travis-ci.org/DeSmart/laravel-layout)

Installation
============

[](#installation)

Add `desmart\laravel-layout` as a requirement to composer.json:

```
{
  "require": {
    "desmart/laravel-layout": "1.2.*"
  }
}
```

Update your packages with `composer update` or install with `composer install`.

In *app/config/app.php* add:

- `'DeSmart\Layout\LayoutServiceProvider',` to providers
- `'Layout'          => 'DeSmart\Layout\Facades\Layout',` to aliases.

Overview
========

[](#overview)

This package provides `DeSmart\Layout\Controller` class which works like normal page controller.
However it can be used to describe complete page structure.

To do this simply define `$layout` which is basic page template, and `$structure` which is an array with section block definition.

Section block is a list of callbacks (let's call them *actions*) which will be run and put in a defined place in template.

Sample page template
--------------------

[](#sample-page-template)

```
>

      {{ $main }}
      {{ $right }}

```

Sample controller
-----------------

[](#sample-controller)

```
