An open API service indexing awesome lists of open source software.

https://github.com/shapecode/twig-string-loader-bundle


https://github.com/shapecode/twig-string-loader-bundle

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

# Shapecode - Twig String Loader Bundle

[![paypal](https://img.shields.io/badge/Donate-Paypal-blue.svg)](http://paypal.me/nloges)

[![PHP Version](https://img.shields.io/packagist/php-v/shapecode/twig-string-loader-bundle.svg)](https://packagist.org/packages/shapecode/twig-string-loader-bundle)
[![Latest Stable Version](https://img.shields.io/packagist/v/shapecode/twig-string-loader-bundle.svg?label=stable)](https://packagist.org/packages/shapecode/twig-string-loader-bundle)
[![Latest Unstable Version](https://img.shields.io/packagist/vpre/shapecode/twig-string-loader-bundle.svg?label=unstable)](https://packagist.org/packages/shapecode/twig-string-loader-bundle)
[![Total Downloads](https://img.shields.io/packagist/dt/shapecode/twig-string-loader-bundle.svg)](https://packagist.org/packages/shapecode/twig-string-loader-bundle)
[![Monthly Downloads](https://img.shields.io/packagist/dm/shapecode/twig-string-loader-bundle.svg?label=monthly)](https://packagist.org/packages/shapecode/twig-string-loader-bundle)
[![Daily Downloads](https://img.shields.io/packagist/dd/shapecode/twig-string-loader-bundle.svg?label=daily)](https://packagist.org/packages/shapecode/twig-string-loader-bundle)
[![License](https://img.shields.io/packagist/l/shapecode/twig-string-loader-bundle.svg)](https://packagist.org/packages/shapecode/twig-string-loader-bundle)

## Install instructions

First you need to add `shapecode/twig-string-loader-bundle` to `composer.json`:

Do it by execute `composer require shapecode/twig-string-loader-bundle` or do it manually

``` json
{
"require": {
"shapecode/twig-string-loader-bundle": "^2.0"
}
}
```

You also have to add `ShapecodeTwigStringLoaderBundle` to your `AppKernel.php` ...

``` php
['all' => true],
];
```

## Usage

Now you can compile strings with twig:

``` php
get('twig')->render('Hello {{ world }}', array(
'world' => 'World'
));
```