zhukmax/twigpad

Lib for add symbols to start or end of string in Twig templates

1.0.4 2020-02-21 11:31 UTC

This package is auto-updated.

Last update: 2024-04-21 20:47:09 UTC


README

Software License Total Downloads

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######