Skip to content

jpass/ThemeBundle

Repository files navigation

JpassThemeBundle

Installation

1. Download using composer

$ composer require jpass/theme-bundle@dev

2. Enable the bundle

Enable the bundle in the kernel

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Jpass\ThemeBundle\JpassThemeBundle(),
        // ...
    );
}

3. Configuration

In app/config/config.yml:

# Twig Configuration
twig:
    ...
    form_themes:
        - 'JpassThemeBundle:theme:_form.html.twig'
    globals:
        theme: 'JpassThemeBundle:theme:layout.html.twig'
        
# Knp Menu Bundle Configuration
knp_menu:
    ...
    twig:
        template: 'JpassThemeBundle:theme:_menu.html.twig'

Usage

In your twig files

{% extends theme %}

{# ... #}