<commit_before># SmartiveHandlebarsBundle
Bundle to integrate Handlebars templates into your Symfony2 application

## Installation

Require the `smartive/handlebars-bundle` package in your composer.json and update your dependencies.

```json
{
    // ...
    "require": {
        "smartive/handlebars-bundle": "dev-master"
    }
    // ..
}
```

Register the bundle and in `app/AppKernel.php`:

``` php
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Smartive\HandlebarsBundle\SmartiveHandlebarsBundle(),
    );
}
```

Some of the features can be configured in the ``migros_components`` section of app/config/config.yml.
Documentation for those features can be found in `Resources/doc/features`.

## Configuration

The Handlebars feature is enabled by default. It can be disabled using the following configuration:

```
smartive_handlebars:
    enabled: false
```

### Template directories

The `template_directories` setting let's you define where to look for Handlebars templates.
You can use Symfony resource notation as well as absolute file paths to configure directories.


```
smartive_handlebars:
    templating:
        template_directories:
            - @AcmeDemo/Resources/views/Templates/
            - /var/www/templates
```

Per default, templates are getting search for in template directories recursively.
You can disable this behaviour as follows:

```
smartive_handlebars:
    templating:
        template_directories_recursive: false
```

## Usage

### Rendering service
The `migros_components.handlebars.templating` service offers a `render` method which can be use to render Handlebars templates.

### Twig

<commit_msg>Adjusting README<commit_after># SmartiveHandlebarsBundle
Bundle to integrate Handlebars templates into your Symfony2 application

## Installation

Require the `smartive/handlebars-bundle` package in your composer.json and update your dependencies.

```json
{
    // ...
    "require": {
        "smartive/handlebars-bundle": "dev-master"
    }
    // ..
}
```

Register the bundle and in `app/AppKernel.php`:

``` php
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Smartive\HandlebarsBundle\SmartiveHandlebarsBundle(),
    );
}
```

Some of the features can be configured in the ``migros_components`` section of app/config/config.yml.
Documentation for those features can be found in `Resources/doc/features`.

## Configuration

### Template directories

The `template_directories` setting let's you define where to look for Handlebars templates.
You can use Symfony resource notation as well as absolute file paths to configure directories.


```
smartive_handlebars:
    templating:
        template_directories:
            - @AcmeDemo/Resources/views/Templates/
            - /var/www/templates
```

Per default, templates are getting search for in template directories recursively.
You can disable this behaviour as follows:

```
smartive_handlebars:
    templating:
        template_directories_recursive: false
```

The Handlebars Twig extension is enabled by default. To disable it add this to your configuration:

```
smartive_handlebars:
    twig:
        enabled: false
```

## Usage

### Rendering service
The `smartive_handlebars.templating.renderer` service offers a `render($templateName, $data)` method which can be use to render Handlebars templates.

### Twig
To render Handlebars templates in Twig you can use the Twig function `handlebars(templateName, data)`.

{'fraction_non_alphanumeric': 0.09003397508493771, 'fraction_numerical': 0.0005662514156285391, 'mean_word_length': 3.7295850066934406, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2029414', 'n_tokens_mistral': 988, 'n_tokens_neox': 946, 'n_words': 334}