2017 © Pedro Peláez
 

library themes

Theme Managing Library for Laravel 4 php framework

image

plutonex/themes

Theme Managing Library for Laravel 4 php framework

  • Saturday, August 10, 2013
  • by raftalks
  • Repository
  • 1 Watchers
  • 14 Stars
  • 31 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Plutonex Theme

Theme library for Laravel 4., (*1)

How to install

Add dependency to the Laravel composer.json file, (*2)

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

and add Service Provider to the app/config/app.php file under array key 'providers', (*3)

'Plutonex\Themes\ThemesServiceProvider',

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/, (*4)

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, (*5)

Tip

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., (*6)

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, (*7)


Route::get('/', function() { pxTheme::setTheme('myTheme'); pxTheme::setLayout('default'); return View::make('hello'); }); Route::group(array('prefix' => 'admin'),function() { pxTheme::setTheme('adminTheme'); pxTheme::setLayout('default'); Route::get('dashboard', function() { return View::make('admin.dashboard'); } Route::get('users', function() { pxTheme::setLayout('list'); 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., (*8)

 // app/routes.php 

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

 Theme::when('/','homePage','myTheme');
 Theme::when('/*','default','myTheme');

 Theme::when('admin','default','adminTheme');
 Theme::when('admin/*','appLayout','adminTheme');

Blade Helpers

@px.theme('themeName')

This helps you set the theme within a blade view template, (*9)

@px.layout('layoutName')

This helps you set the theme layout within a blade view, (*10)

@px.include('path.to.view')

This helps include a view file within the current theme directory, (*11)

The Versions

10/08 2013

dev-master

9999999-dev

Theme Managing Library for Laravel 4 php framework

  Sources   Download

BSD

The Requires

 

laravel theme laravel4 plutonex

10/08 2013

1.0.2

1.0.2.0

Theme Managing Library for Laravel 4 php framework

  Sources   Download

BSD

The Requires

 

laravel theme laravel4 plutonex

10/08 2013

1.0.1

1.0.1.0

  Sources   Download

The Requires

 

10/08 2013

1.0.0

1.0.0.0

  Sources   Download

The Requires