spiral/twig-bridge
最新稳定版本:v2.0.1
Composer 安装命令:
composer require spiral/twig-bridge
包简介
Spiral Framework: Twig Adapter
README 文档
README
Documentation | Framework Bundle
Installation
The extension requires spiral/views package.
composer require spiral/twig-bridge
To enable extension modify your application by adding Spiral\Twig\Bootloader\TwigBootloader:
class App extends Kernel { /* * List of components and extensions to be automatically registered * within system container on application start. */ protected const LOAD = [ // ... Spiral\Twig\Bootloader\TwigBootloader::class, ]; }
Configuration
You can enable any custom twig extension by requesting Spiral\Twig\TwigEngine in your bootloaders:
class TwigExtensionBootloader extends Bootloader { public function boot(TwigEngine $engine) { $engine->addExtension(new Extension()); } }
Lazy Configuration
To configure TwigEngine on demand use functionality provided by TwigBootloader:
class TwigExtensionBootloader extends Bootloader { public function boot(TwigBootloader $twig) { $twig->addExtension('container.binding'); } }
Note Following methods are available
setOption,addExtension,addProcessor.
License:
MIT License (MIT). Please see LICENSE for more information. Maintained by Spiral Scout.
统计信息
- 总下载量: 61.42k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 5
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-02