<!---
# 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
-->

# Usage

When you have **ChillDevProxyTemplatingBundle** installed in your system and configured, you can start using `default` templating engine to make your bundle co-operative with different templating engines out of the box.

## Template rendering

First way is to use `default` engine as template name suffix:

```php
return $this->render('Bundle:Controller:action.html.default');
```

**Note:** you don't create any physical files like `action.html.default` - template name resolving is done before real rendering is done and your templates are still named `action.html.twig`/`action.html.php`.

## `@Template` annotation

You can also use `default` engine with `@Template` annotation:

```php
/**
 * @Template(engine="default")
 */
public function fooAction()
{
}
```

## Streaming

Like with `DelegatingEngine`, even though `ProxyEngine` implements `StreamingEngineInterface` it doesn't mean you can use streaming anytime you want - it just allows to proxy streaming of real engine. If it is not supported by destination engine, `ProxyEngine` will throw exception.
