2017 © Pedro Peláez
 

library theme

Easy theme Management for Laravel 4

image

lightgear/theme

Easy theme Management for Laravel 4

  • Monday, March 24, 2014
  • by ralf57
  • Repository
  • 3 Watchers
  • 11 Stars
  • 64 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Drop-in theme support for Laravel 4

Overview

The Lightgear Theme package adds support for themes to a Laravel 4 application., (*1)

Features

  • Views overrides for both app and packages
  • Theme assets (css, less and js) support via Lightgear Asset package

Installation

Via Laravel 4 Package Installer

php artisan package:install lightgear/theme

Manual

Just require, (*2)

"lightgear/theme": "dev-master"

in your composer.json and run, (*3)

composer update

Then register the service provider, (*4)

'Lightgear\Asset\ThemeServiceProvider'

and, optionally, the alias, (*5)

'Theme' => 'Lightgear\Theme\Facades\Theme'

in app/config/app.php, (*6)

Important: regardless of the installation method, until I find a better way to handle this, make sure to have the ThemeServiceProvider as the last registered or, at least, after the service providers containing the views you want to override.
This is needed in order to override the packages' views., (*7)

Usage

First create the directory that will contain your themes. By default this is "themes" located in the application root but this can be changed in the config file. A tipical theme structure would be:, (*8)


themes |__mytheme |__css/ |__less/ |__js/ |__views/ |__info.php

As you notice each theme must have an info.php file with the following contents:, (*9)


return array( 'name' => 'My theme', 'description' => 'A good desc', 'author' => 'Donato Rotunno', 'version' => 1.0, 'styles' => array( 'paths' => array( 'less', 'css' ), 'package' => 'mytheme', 'group' => 'frontend' // optional asset group ), 'scripts' => array( 'paths' => array( 'js', ), 'package' => 'mytheme', 'group' => 'frontend' // optional asset group ), );

This is a pretty simple structure. For more information about the theme assets, please refer to Lightgear Asset documentation., (*10)

Views overrides

To override any views (be it from app or package) just create the corresponding file in the views directory.
For example, to override the view package::posts.index just create the file views/package/posts/index.php. The same goes with the views located in the app. The view posts.index would be overridden in views/posts/index.php., (*11)

Configuration

Both the themes directory and the active theme can be set in the config file., (*12)

Changelog

0.5: initial release, (*13)

The Versions

24/03 2014

dev-master

9999999-dev

Easy theme Management for Laravel 4

  Sources   Download

The Requires

 

23/03 2014

dev-develop

dev-develop

Easy theme Management for Laravel 4

  Sources   Download

The Requires

 

28/12 2013

2.0.0

2.0.0.0

Easy theme Management for Laravel 4

  Sources   Download

The Requires

 

06/11 2013

0.5

0.5.0.0

Easy theme Management for Laravel 4

  Sources   Download

The Requires