定制 row-bloom/twig-interpolator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

row-bloom/twig-interpolator

最新稳定版本:v0.2.0

Composer 安装命令:

composer require row-bloom/twig-interpolator

包简介

row-bloom Twig interpolator driver

README 文档

README

Latest Version on Packagist Pest action Pint action Total Downloads

Important

This is a sub-split, for development, pull requests and issues, visit: https://github.com/row-bloom/row-bloom

Installation

composer require row-bloom/twig-interpolator
use RowBloom\RowBloom\Support;
use RowBloom\TwigInterpolator\TwigInterpolator;

app()->get(Support::class);
    ->registerInterpolatorDriver(TwigInterpolator::NAME, TwigInterpolator::class)

Requires:

  • PHP >= 8.1

Usage

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

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 31
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-26