Download the PHP package zeliard91/twigstring-bundle without Composer
On this page you can find all versions of the php package zeliard91/twigstring-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zeliard91/twigstring-bundle
More information about zeliard91/twigstring-bundle
Files in zeliard91/twigstring-bundle
Package twigstring-bundle
Short Description Renders strings instead of files with Twig
License MIT
Homepage https://github.com/zeliard91/TwigstringBundle
Informations about the package twigstring-bundle
TwigstringBundle information & howto
This Symfony2 Bundle adds the possibility to render strings instead of files with the Symfony2 native Twig templating engine.
The Bundle adds an additional service named twigstring
. It is used the same way as the original templating service.
The only difference is that the first argument of the method render(<string>, [<array])
is a string to parse instead of a template file.
The bundles supports variable output, conditions, loops and rendering of an controller. It does NOT support including templates, yet. It would interpret the template name as twigstring.
One example usage scenario is to load templates from the database instead of using files.
Extension ideas:
- option to include templates
- add a black-/whitelist for allowed allowed twig tags
Installation
1. Register the bundle in composer
You need to add it to your composer.json requirements:
2. Downloading the bundle from packagist
Install it by running the following command:
$ ./composer.phar update zeliard91/twigstring-bundle
3. Registering the bundle in the kernel
4. Registering the bundle in the configuration
5. Add additional extensions you are in need of (optional)
For a list of available extensions see fabpot/Twig-extensions or create one on your own with Symfony Cookbook and twig doc.
Usage
or use the short way:
Example output:
u v x y z
License
The bundle is licensed under MIT license. For full license see LICENSE file
Authors
LarsK (Lars Krüger), cordoval (Luis Cordova), r1pp3rj4ck (Attila Bukor), zeliard91 (Damien Matabon)