Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shapecode/theme-bundle


https://github.com/shapecode/theme-bundle

Last synced: 8 days ago
JSON representation

Awesome Lists containing this project

README

        

Theme Bundle
============

This bundle provides you the possibility to add themes to each bundle. In your
bundle directory it will look under `Resources/themes/` or fall back
to the normal Resources/views if no matching file was found.

## Installation

Installation is a quick (I promise!) 3 step process:

1. Download ShapecodeThemeBundle
2. Enable the Bundle

### Step 1: Install ShapecodeThemeBundle with composer

Run the following composer require command:

``` bash
$ php composer.phar require shapecode/theme-bundle

```

### Step 2: Enable the bundle

Finally, enable the bundle in the kernel:

``` php


Placeholder
Representation
Example


%app_path%
Path where application resources are located
app/Resources


%bundle_path%
Path where bundle located, for example
src/Vendor/CoolBundle/VendorCoolBundle


%bundle_name%
Name of the bundle
VendorCoolBundle


%dir%
Directory, where resource should looking first



%current_theme%
Name of the current active theme


%template%
Template name
view.html.twig


%override_path%
Like template, but with views directory
views/list.html.twig

### Change Active Theme

For that matter have a look at the ThemeRequestListener.

If you are early in the request cycle and no template has been rendered you
can still change the theme without problems. For this the theme service
exists at:

``` php
$activeTheme = $container->get('shapecode_theme.active_theme');
echo $activeTheme->getName();
$activeTheme->setName("phone");
```

## Contribution

Active contribution and patches are very welcome.

First install dependencies:

```bash
composer.phar install --dev
```