定制 tomasvotruba/torch 二次开发

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

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

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.

Downloads


Install

composer require tomasvotruba/torch --dev

Usage

  1. Create torch.php in 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;
    },
]);

  1. Run torch your twig files directories:
vendor/bin/torch run templates

Behind Scenes

Happy coding!

统计信息

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

GitHub 信息

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

其他信息

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