Download the PHP package phptransformers/phptransformer without Composer
On this page you can find all versions of the php package phptransformers/phptransformer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phptransformers/phptransformer
More information about phptransformers/phptransformer
Files in phptransformers/phptransformer
Package phptransformer
Short Description Normalize the API of any PHPTransformer.
License MIT
Homepage https://github.com/phptransformers/phptransformer
Informations about the package phptransformer
PHPTransformer
Common interface to manipulate strings/data with any transformer. Great for use in templating libraries, static site generators, web frameworks, and more. Inspired by JSTransformers.
Supported Transformers
To use each of these transformers, you will also need to composer require
them in your project.
- Twig (From SensioLabs/Symfony)
- Smarty
- Mustache
- Latte (From Nette Framework)
- StringTemplate
- Plates (From The PHP League)
- Dwoo
- Blade (From Laravel Framework)
- PHPTAL
- Text-Template (From PHPUnit)
Install
Via Composer
Usage
API
Before all examples, you will need to load a transformer:
See each transformers' repository for more details
->render($template, $locals)
Renders the given template string, using the provides locals for options passed in. Returns the result as a string.
->renderFile($file, $locals)
Renders the given file, using the provided locals for options passed in. Returns the result as a string.
Testing
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.