shapecode / twig-string-loader-bundle
Adds a string loader to twig
Fund package maintenance!
Liberapay
paypal.me/nloges
Installs: 118 228
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.1
- shapecode/twig-string-loader: ^2.0
- symfony/config: ^5.4 || ^6.4 || ^7.0
- symfony/dependency-injection: ^5.4 || ^6.4 || ^7.0
- symfony/framework-bundle: ^5.4 || ^6.4 || ^7.0
- symfony/http-kernel: ^5.4 || ^6.4 || ^7.0
- symfony/twig-bundle: ^5.4 || ^6.4 || ^7.0
- symfony/yaml: ^5.4 || ^6.4 || ^7.0
Requires (Dev)
- doctrine/coding-standard: ^12.0
- icanhazstring/composer-unused: ^0.8
- maglnet/composer-require-checker: ^4.7
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^10.5
- roave/security-advisories: dev-master
- squizlabs/php_codesniffer: ^3.7
- symfony/var-dumper: ^7.0
README
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
{ "require": { "shapecode/twig-string-loader-bundle": "^2.0" } }
You also have to add ShapecodeTwigStringLoaderBundle
to your AppKernel.php
...
<?php // app/AppKernel.php //... class AppKernel extends Kernel { //... public function registerBundles() { $bundles = array( ... new Shapecode\Bundle\TwigStringLoaderBundle\ShapecodeTwigStringLoaderBundle(), ); //... return $bundles; } //... }
... or bundles.php
when you don't use Symfony Flex.
<?php // bundles.php //... return [ // ..... Shapecode\Bundle\TwigStringLoaderBundle\ShapecodeTwigStringLoaderBundle::class => ['all' => true], ];
Usage
Now you can compile strings with twig:
<?php $this->get('twig')->render('Hello {{ world }}', array( 'world' => 'World' ));