Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 797 Bytes

README.md

File metadata and controls

32 lines (24 loc) · 797 Bytes

TwigPad

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