StandardFilters
in package
This class is a collection of token filter functions. For example, consider this message:
"Hello {contact.first_name|upper}!"
The "upper" filter corresponds to method upper()
.
All public methods should have the same signature (mixed $value, array $filter, string $format).
Table of Contents
Methods
- boolean() : int
- Convert to boolean.
- capitalize() : string
- Convert to title case (each word is capitalized).
- crmDate() : mixed
- default() : mixed
- Return value, falling back to default.
- lower() : string
- Convert to lowercase.
- upper() : string
- Convert to uppercase.
Methods
boolean()
Convert to boolean.
public
static boolean(string $value, array<string|int, mixed> $filter, string $format) : int
Parameters
- $value : string
- $filter : array<string|int, mixed>
- $format : string
Tags
Return values
intcapitalize()
Convert to title case (each word is capitalized).
public
static capitalize(string $value, array<string|int, mixed> $filter, string $format) : string
The use of the verb 'capitalize' is to align with smarty
Parameters
- $value : string
- $filter : array<string|int, mixed>
- $format : string
Tags
Return values
stringcrmDate()
public
static crmDate(mixed $value, array<string|int, mixed> $filter, string $format) : mixed
Parameters
- $value : mixed
- $filter : array<string|int, mixed>
- $format : string
default()
Return value, falling back to default.
public
static default(mixed $value, array<string|int, mixed> $filter, string $format) : mixed
Parameters
- $value : mixed
- $filter : array<string|int, mixed>
- $format : string
Tags
lower()
Convert to lowercase.
public
static lower(string $value, array<string|int, mixed> $filter, string $format) : string
Parameters
- $value : string
- $filter : array<string|int, mixed>
- $format : string
Tags
Return values
stringupper()
Convert to uppercase.
public
static upper(mixed $value, array<string|int, mixed> $filter, string $format) : string
Parameters
- $value : mixed
- $filter : array<string|int, mixed>
-
The list of filter criteria, as requested in this template.
- $format : string
-
The format of the active template ('text/plain' or 'text/html').