Theme Managing Library for Laravel 4 php framework

Installs: 26

Dependents: 0

Suggesters: 0

Stars: 14

Watchers: 1

Forks: 3

Open Issues: 1

1.0.2 2013-08-10 11:22 UTC


Theme library for Laravel 4.

How to install

Add dependency to the Laravel composer.json file

"require": {
        "plutonex/themes": "1.0.*"

and add Service Provider to the app/config/app.php file under array key 'providers'


You are required to create a 'themes' folder under the public directory of laravel app. For example all your themes should be developed under /public/themes/

Your themes should be basic laravel views inside the themes directory within a directory with theme name. For example, if you want to create a theme called 'myTheme', the layouts of the theme should be within the path /public/themes/myTheme/layouts


You can create sub directories under your theme folder, like 'partials' to keep parts of the theme file in common and 'assets' folder to keep all your assets.

How to use inside Routes

There are many ways to use this library. The easiest way is to set the theme and layout inside a app/routes.php

    Route::get('/', function()

        return View::make('hello');

    Route::group(array('prefix' => 'admin'),function()

        Route::get('dashboard', function()
            return View::make('admin.dashboard');

        Route::get('users', function()

            return View::make('admin.dashboard');


You can either choose to set theme and layout as shown above or simply bind your URI pattern with theme and layout.

 // app/routes.php 

 // Theme::when({pattern},{layout},{theme});



Blade Helpers


This helps you set the theme within a blade view template


This helps you set the theme layout within a blade view


This helps include a view file within the current theme directory