phptransformers/text-template

PHPUnit's Text_Template implementation of PhpTransformer.

1.0.0 2016-02-28 21:29 UTC

This package is auto-updated.

Last update: 2024-10-17 00:04:13 UTC


README

PHPUnit's Text_Template support for PHPTransformers.

Install

Via Composer

$ composer require phptransformers/text-template

Usage

$engine = new TextTemplateTransformer();
echo $engine->render('Hello, {name}!', array('name' => 'phptransformers'));

Options

$engine = new TextTemplateTransformer(array(
    'open-delimiter' => '{', // Default to '{' (Text_Template default)
    'close-delimiter' => '}' // Default to '}' (Text_Template default)
));

// ...

$textTemplate = new \Text_Template();
$engine = new TextTemplateTransformer(array(
    'text-template' => $textTemplate // All others options are ignored
));

Testing

$ composer test

License

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