Download the PHP package jasny/twig-extensions without Composer
On this page you can find all versions of the php package jasny/twig-extensions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package twig-extensions
Jasny Twig Extensions
A number of useful filters for Twig.
Installation
Jasny's Twig Extensions can be easily installed using composer
composer require jasny/twig-extensions
Usage
To use in a Symfony project register the extensions as a service.
Date extension
Format a date based on the current locale. Requires the intl extension.
- localdate - Format the date value as a string based on the current locale
- localtime - Format the time value as a string based on the current locale
- localdatetime - Format the date/time value as a string based on the current locale
- age - Get the age (in years) based on a date
- duration - Get the duration string from seconds
PCRE
Exposes PCRE to Twig.
- preg_quote - Quote regular expression characters
- preg_match - Perform a regular expression match
- preg_get - Perform a regular expression match and return the matched group
- preg_get_all - Perform a regular expression match and return the group for all matches
- preg_grep - Perform a regular expression match and return an array of entries that match the pattern
- preg_replace - Perform a regular expression search and replace
- preg_filter - Perform a regular expression search and replace, returning only matched subjects.
- preg_split - Split text into an array using a regular expression
Text
Convert text to HTML + string functions
- paragraph - Add HTML paragraph and line breaks to text
- line - Get a single line of text
- less - Cut of text on a page break
- truncate - Cut off text if it's too long
- linkify - Turn all URLs into clickable links (also supports Twitter @user and #subject)
Array
Brings PHP's array functions to Twig
- sum - Calculate the sum of values in an array
- product - Calculate the product of values in an array
- values - Return all the values of an array
- as_array - Cast an object to an associated array
- html_attr - Turn an array into an HTML attribute string
All versions of twig-extensions with dependencies
PHP Build Version
Package Version
The package jasny/twig-extensions contains the following files
Loading the files please wait ....