2017 © Pedro Peláez
 

library phptransformer-twital

Twital implementation of PhpTransformer

image

macfja/phptransformer-twital

Twital implementation of PhpTransformer

  • Sunday, December 27, 2015
  • by MacFJA
  • Repository
  • 1 Watchers
  • 2 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Twital for PHPTransformers

Twital support for PHPTransformers., (*1)

Install

Via Composer, (*2)

``` bash $ composer require macfja/phptransformer-twital, (*3)


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

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, (*4)

``` php $engine = new TwitalTransformer(); echo $engine->render( ', (*5)

  • {{ user.name }}
', array( 'users' => array( array('name' => 'phptransformers'), array('name' => 'twig'), array('name' => 'twital') ), '__twital-adapter' => new HTML5Adapter() ) );

## Testing ``` bash $ phpunit

License

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

The Versions

27/12 2015

dev-master

9999999-dev

Twital implementation of PhpTransformer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar MacFJA

twig templates tal phptransformer phptransformers twital