PHPackages                             macfja/phptransformer-twital - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. macfja/phptransformer-twital

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

macfja/phptransformer-twital
============================

Twital implementation of PhpTransformer

26PHP

Since Dec 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/MacFJA/phptransformer-twital)[ Packagist](https://packagist.org/packages/macfja/phptransformer-twital)[ RSS](/packages/macfja-phptransformer-twital/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Twital for PHPTransformers
==========================

[](#twital-for-phptransformers)

[Twital](https://github.com/goetas/twital) support for [PHPTransformers](http://github.com/phptransformers/phptransformer).

Install
-------

[](#install)

Via Composer

```
$ composer require macfja/phptransformer-twital
```

Usage
-----

[](#usage)

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

### Special case for string rendering (`render`)

[](#special-case-for-string-rendering-render)

If you are using `TwitalTransformer` to render template stored in a string variable, you need to indicate to Twital plugin the type of string you are about to use (HTML5, XML, XHTML).
To do so you can pass a *magic* parameter to the `render` function. The parameter is named `__twital-adapter` and its value is an instance of `\Goetas\Twital\SourceAdapter`

```
$engine = new TwitalTransformer();
echo $engine->render(
    '

            {{ user.name }}

    ',
    array(
        'users' => array(
            array('name' => 'phptransformers'),
            array('name' => 'twig'),
            array('name' => 'twital')
        ),
        '__twital-adapter' => new HTML5Adapter()
    )
);
```

Testing
-------

[](#testing)

```
$ phpunit
```

License
-------

[](#license)

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

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1475671?v=4)[MacFJA](/maintainers/MacFJA)[@MacFJA](https://github.com/MacFJA)

---

Top Contributors

[![MacFJA](https://avatars.githubusercontent.com/u/1475671?v=4)](https://github.com/MacFJA "MacFJA (2 commits)")

### Embed Badge

![Health badge](/badges/macfja-phptransformer-twital/health.svg)

```
[![Health](https://phpackages.com/badges/macfja-phptransformer-twital/health.svg)](https://phpackages.com/packages/macfja-phptransformer-twital)
```

###  Alternatives

[ergebnis/license

Provides an abstraction of an open-source license.

142.5M94](/packages/ergebnis-license)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
