tomasvotruba/torch
最新稳定版本:0.3.9
Composer 安装命令:
composer require tomasvotruba/torch
包简介
Smoke testing of TWIG templates
README 文档
README
...when you need to cover your Twig with smoke.
Install
composer require tomasvotruba/torch --dev
Usage
- Create
torch.phpin your project root:
use Twig\Environment; require_once __DIR__ . '/vendor/autoload.php'; // create instance of Environment with everything needed for smoke render $environment = new Environment(...); return $environment;
In this file, you can override existing twig functions:
// override twig functions you need StaticParameterProvider::set('overrideFunctions', [ // provide static value for dynamic function 'baseTemplate' => function () { return DummyTheme::LAYOUT_NAME; }, ]);
- Run torch your twig files directories:
vendor/bin/torch run templates
Behind Scenes
- https://tomasvotruba.com/blog/twig-smoke-rendering-why-do-we-even-need-it/
- https://tomasvotruba.com/blog/twig-smoke-rendering-journey-of-fails/
- https://tomasvotruba.com/blog/twig-smoke-rendering-fortune-favors-the-bold
Happy coding!
统计信息
- 总下载量: 17.45k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-19