2017 © Pedro Peláez
 

symfony-bundle theming-bundle

A service to that lets you choose the theme bundle to use

image

djaney/theming-bundle

A service to that lets you choose the theme bundle to use

  • Friday, June 10, 2016
  • by djaney
  • Repository
  • 1 Watchers
  • 0 Stars
  • 224 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Creates a simple theming using a Child Theme and a Base Theme., (*1)

If the template name exists in the child, the child bundle template is used., (*2)

Else, The base theme will be used., (*3)

The Base theme is set in the service.yml while the Child is passed during the service call., (*4)

src
|-BaseThemeBundle/Resources/views/**.html.twig
|-ChildThemeBundle/Resources/views/**.html.twig

A Theme is simply a bundle with views., (*5)

Installation

In composer.json

"require": {
    "djaney/theming-bundle": "dev-master"
}

Usage

Register the service

Second argument is the name of the base theme, (*6)

services:
    theme:
        class: Djaney\ThemingBundle\ThemeSelector\ThemeSelectorService
        arguments: [ "@twig" , BaseThemeBundle ]

Use in Controller

second argument is the theme name. Set as NULL to use base theme.

return $this->get('theme')->template('Default/index.html.twig', 'ChildThemeBundle', $data);

The Versions

10/06 2016

dev-master

9999999-dev

A service to that lets you choose the theme bundle to use

  Sources   Download

The Requires

 

by Djane Rey Mabelin