Search by

This package is abandoned and no longer maintained. No replacement package was suggested.

Smoke testing of TWIG templates

Package info

github.com/TomasVotruba/torch

pkg:composer/tomasvotruba/torch

Statistics

Installs: 29 237

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 0

0.3.9 2024-01-29 18:09 UTC

README

Warning

This package is deprecated and no longer maintained or updated. The repository is archived.

...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!