<!---
# This file is part of the ChillDev ProxyTemplating bundle.
#
# @author Rafał Wrzeszcz <rafal.wrzeszcz@wrzasq.pl>
# @copyright 2013 © by Rafał Wrzeszcz - Wrzasq.pl.
# @version 0.0.1
# @since 0.0.1
# @package ChillDev\Bundle\ProxyTemplatingBundle
-->

# Installation

**Note:** this bundle requires **PHP 5.4**.

## Step 1: define composer dependency

Add `"chilldev/proxy-templating-bundle": "dev-master"` to your `composer.json` file (replace `dev-master` with your desired constraint if you want to use particular version). Then run `composer.phar install`.

**Note:** `dev-master` is a reference to `master` branch which is **stable** - to use current development branch with latest updates use `dev-develop`.

## Step 2: include bundle in your kernel

Simply add following lines to your kernel:

```php
<?php

// in your use-s addd:
use ChillDev\Bundle\ProxyTemplatingBundle\ChillDevProxyTemplatingBundle;

// in your kernel class:
public function registerBundles()
{
    // your bubdles list
    $bundles = [
        'ChillDevProxyTemplatingBundle',
        …
    ];

    …
}
```

## Step 3: enabling templating switch

Another thing you need to do is enabling *default* templating engine. It is our proxy templating engine that allows switching templating engine from configuration level (it is not the same as *DelegatingEngine* from Symfony):

```yaml
framework:
    templating:
        engines:
            - "twig"
            - "php"
            - "default"
```

## Step 4: configuration

Finally, you need to define underlying templating engine to use in your system as default engine:

```yaml
chilldev_proxytemplating:
    templating: "php" # or "twig", "smarty" or anything you want to use
```

For details see [Configuration section](./configuration.md).
