https://github.com/row-bloom/twig-interpolator
Row bloom driver: Add support of Twig templates to generate HTML. [READONLY]
https://github.com/row-bloom/twig-interpolator
html templating twig
Last synced: 21 days ago
JSON representation
Row bloom driver: Add support of Twig templates to generate HTML. [READONLY]
- Host: GitHub
- URL: https://github.com/row-bloom/twig-interpolator
- Owner: row-bloom
- License: mit
- Created: 2023-10-26T18:45:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-01T16:10:32.000Z (over 2 years ago)
- Last Synced: 2025-05-26T17:48:08.817Z (about 1 year ago)
- Topics: html, templating, twig
- Language: PHP
- Homepage: https://twig.symfony.com/doc/3.x/templates.html
- Size: 81.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Row bloom
[](https://packagist.org/packages/row-bloom/twig-interpolator)
[](https://github.com/row-bloom/row-bloom/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/row-bloom/row-bloom/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[](https://packagist.org/packages/row-bloom/twig-interpolator)
> [!IMPORTANT]
> This is a sub-split, for development, pull requests and issues, visit:
## Installation
```bash
composer require row-bloom/twig-interpolator
```
```php
use RowBloom\RowBloom\Support;
use RowBloom\TwigInterpolator\TwigInterpolator;
app()->get(Support::class);
->registerInterpolatorDriver(TwigInterpolator::NAME, TwigInterpolator::class)
```
Requires:
- PHP >= 8.1
## Usage
```php
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('
{{ title }}
Bold text
{{ body }}
')
->setRenderer(HtmlRenderer::class)
->save(__DIR__.'/foo.pdf');
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.