class Filters extends Twig_Extension

This class is a Twig extension custom filter that implements 'jscode' to replace the deprecated raw filter

Properties

private TranslatorInterface $translator

Methods

void
__construct(TranslatorInterface $translator)

Constructor of class Filters

string
getName()

Returns the extension class name

array
getFilters()

Registers the new filters

string
jscodeFilter(string $string)

Returns the string as is without any modification

string
htmlRaw(RichText|string $string)

Returns the string as HTML raw

string
noFilter(RichText|string $string)

Returns the string as is without any modification

string
replaceFootnotesReference(RichText|string $string)

Replaces footnotes reference in a text by a html link

string
removeFootnotesReference(RichText|string $string)

Removes footnotes reference in a text

mixed
numberFormat(mixed $number, mixed $decimals = 0, mixed $dec_point = ".", mixed $thousands_sep = ",", mixed $thousands_size = 3)

function numberFormat

Details

at line 57
void __construct(TranslatorInterface $translator)

Constructor of class Filters

Parameters

TranslatorInterface $translator The translator interface

Return Value

void

at line 68
string getName()

Returns the extension class name

Return Value

string The extension class name

at line 79
array getFilters()

Registers the new filters

Return Value

array List a new available filters

at line 98
string jscodeFilter(string $string)

Returns the string as is without any modification

Parameters

string $string The string to be filtered

Return Value

string

at line 110
string htmlRaw(RichText|string $string)

Returns the string as HTML raw

Parameters

RichText|string $string The string to be filtered

Return Value

string

at line 144
string noFilter(RichText|string $string)

Returns the string as is without any modification

Parameters

RichText|string $string The string to be filtered

Return Value

string

at line 157
string replaceFootnotesReference(RichText|string $string)

Replaces footnotes reference in a text by a html link

Parameters

RichText|string $string

Return Value

string

at line 173
string removeFootnotesReference(RichText|string $string)

Removes footnotes reference in a text

Parameters

RichText|string $string

Return Value

string

at line 193
mixed numberFormat(mixed $number, mixed $decimals = 0, mixed $dec_point = ".", mixed $thousands_sep = ",", mixed $thousands_size = 3)

function numberFormat

Parameters

mixed $number
mixed $decimals (default: 0)
mixed $dec_point (default: ".")
mixed $thousands_sep (default: ",")
mixed $thousands_size (default: 3)

Return Value

mixed