shapecode/twig-string-loader-bundle
最新稳定版本:4.0.0
Composer 安装命令:
composer require shapecode/twig-string-loader-bundle
包简介
Adds a string loader to twig
README 文档
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' ));
统计信息
- 总下载量: 143.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-10