zhukmax / twigpad
Lib for add symbols to start or end of string in Twig templates
1.0.4
2020-02-21 11:31 UTC
Requires
- php: ^7.0.1
- twig/twig: ^3.0
- zhukmax/stringpad: ^1.1.0
README
Lib for add symbols to start or end of string in Twig templates.
Install
composer require zhukmax/twigpad
Usage
Basic example:
<?php require_once 'vendor/autoload.php'; $loader = new Twig_Loader_Array(array( 'index' => 'Hello {{ rightpad(name, 9, "#") }}', )); $twig = new Twig_Environment($loader); $twig->addExtension(new Zhukmax\TwigPad\TwigPad()); echo $twig->render('index', array('name' => 'Max')); // => Hello Max######