row-bloom Twig 混插器驱动程序
v0.2.0
2024-01-01 16:06 UTC
Requires
- twig/twig: ^3.6
This package is auto-updated.
Last update: 2024-09-30 17:35:41 UTC
README
重要
这是一个子包,用于开发、拉取请求和问题,请访问: https://github.com/row-bloom/row-bloom
安装
composer require row-bloom/twig-interpolator
use RowBloom\RowBloom\Support; use RowBloom\TwigInterpolator\TwigInterpolator; app()->get(Support::class); ->registerInterpolatorDriver(TwigInterpolator::NAME, TwigInterpolator::class)
要求
- PHP >= 8.1
用法
use RowBloom\TwigInterpolator\TwigInterpolator; use RowBloom\RowBloom\Renderers\HtmlRenderer; use RowBloom\RowBloom\RowBloom; app()->get(RowBloom::class) ->addTable([ ['title' => 'Title1', 'body' => 'body1'], ['title' => 'Title2', 'body' => 'body2'], ]) ->setInterpolator(TwigInterpolator::NAME) ->setTemplate(' <h1>{{ title }}</h1> <p>Bold text</p> <div>{{ body }}</div> ') ->setRenderer(HtmlRenderer::class) ->save(__DIR__.'/foo.pdf');
变更日志
请参阅 CHANGELOG 获取最近更改的更多信息。
贡献
请参阅 CONTRIBUTING 获取详细信息。
许可
MIT 许可证 (MIT)。请参阅 许可文件 获取更多信息。