Documentation

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
noinspection

PhpUnusedParameterInspection

Return values
int

capitalize()

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
see
https://www.smarty.net/docsv2/en/language.modifiers.tpl#language.modifier.capitalize
throws
CRM_Core_Exception
noinspection

PhpUnusedParameterInspection

Return values
string

crmDate()

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
noinspection

PhpUnusedParameterInspection

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
throws
CRM_Core_Exception
noinspection

PhpUnusedParameterInspection

Return values
string

upper()

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').

Tags
throws
CRM_Core_Exception
noinspection

PhpUnusedParameterInspection

Return values
string

        
On this page

Search results