Skip to content

Latest commit

 

History

History
60 lines (48 loc) · 2.2 KB

Text.md

File metadata and controls

60 lines (48 loc) · 2.2 KB

The Text Extension

<?php

$loader = new Twig_Loader_Filesystem('/path/to/templates');
$twig   = new Twig_Environment($loader);
$twig->addExtension(new \KzykHys\TwigExtensions\Extension\Text());

Filters

Name Extension Description
center Text Centers the value in a field of a given width.
filesizeformat Text Format the value like a ‘human-readable’ file size (i.e. 13 kB, 4.1 MB, 102 Bytes, etc)
md5 Text Calculate the md5 hash of a string
sha1 Text Calculate the sha1 hash of a string
sha512 Text Calculate the sha512 hash of a string

Functions

Name Extension Description
lipsum Text Generates some lorem ipsum for the template