Filters
in package
View filters
Table of Contents
- capitalize() : string
- Returns $value as all lowercase with the first letter capitalized.
- date() : string
- Formats a date into the given $format.
- default() : string
- Returns the given default value if $value is empty or undefined.
- esc() : string
- Escapes the given value with our `esc()` helper function.
- excerpt() : string
- Returns an excerpt of the given string.
- highlight() : string
- Highlights a given phrase within the text using '<mark></mark>' tags.
- highlight_code() : string
- Highlights code samples with HTML/CSS.
- limit_chars() : string
- Limits the number of characters to $limit, and trails of with an ellipsis.
- limit_words() : string
- Limits the number of words to $limit, and trails of with an ellipsis.
- local_currency() : string
- Returns the $value displayed as a currency string.
- local_number() : string
- Returns the $value displayed in a localized manner.
- nl2br() : string
- Returns a string with all instances of newline character (\n) converted to an HTML <br/> tag.
- prose() : string
- Takes a body of text and uses the auto_typography() method to turn it into prettier, easier-to-read, prose.
- round() : string|float
- Rounds a given $value in one of 3 ways;
- title() : string
- Returns a "title case" version of the string.
Methods
capitalize()
Returns $value as all lowercase with the first letter capitalized.
public
static capitalize(string $value) : string
Parameters
- $value : string
Return values
string —date()
Formats a date into the given $format.
public
static date(mixed $value, string $format) : string
Parameters
- $value : mixed
- $format : string
Return values
string —default()
Returns the given default value if $value is empty or undefined.
public
static default(mixed $value, string $default) : string
Parameters
- $value : mixed
- $default : string
Return values
string —esc()
Escapes the given value with our `esc()` helper function.
public
static esc(string $value[, string $context = 'html' ]) : string
Parameters
- $value : string
- $context : string = 'html'
Return values
string —excerpt()
Returns an excerpt of the given string.
public
static excerpt(string $value, string $phrase[, int $radius = 100 ]) : string
Parameters
- $value : string
- $phrase : string
- $radius : int = 100
Return values
string —highlight()
Highlights a given phrase within the text using '<mark></mark>' tags.
public
static highlight(string $value, string $phrase) : string
Parameters
- $value : string
- $phrase : string
Return values
string —highlight_code()
Highlights code samples with HTML/CSS.
public
static highlight_code(string $value) : string
Parameters
- $value : string
Return values
string —limit_chars()
Limits the number of characters to $limit, and trails of with an ellipsis.
public
static limit_chars(string $value[, int $limit = 500 ]) : string
Will break at word break so may be more or less than $limit.
Parameters
- $value : string
- $limit : int = 500
Return values
string —limit_words()
Limits the number of words to $limit, and trails of with an ellipsis.
public
static limit_words(string $value[, int $limit = 100 ]) : string
Parameters
- $value : string
- $limit : int = 100
Return values
string —local_currency()
Returns the $value displayed as a currency string.
public
static local_currency(int|float $value, string $currency[, string|null $locale = null ][, int $fraction = null ]) : string
Parameters
- $value : int|float
- $currency : string
- $locale : string|null = null
- $fraction : int = null
Return values
string —local_number()
Returns the $value displayed in a localized manner.
public
static local_number(int|float $value[, string $type = 'decimal' ][, int $precision = 4 ][, string|null $locale = null ]) : string
Parameters
- $value : int|float
- $type : string = 'decimal'
- $precision : int = 4
- $locale : string|null = null
Return values
string —nl2br()
Returns a string with all instances of newline character (\n) converted to an HTML <br/> tag.
public
static nl2br(string $value) : string
Parameters
- $value : string
Return values
string —prose()
Takes a body of text and uses the auto_typography() method to turn it into prettier, easier-to-read, prose.
public
static prose(string $value) : string
Parameters
- $value : string
Return values
string —round()
Rounds a given $value in one of 3 ways;
public
static round(string $value[, mixed $precision = 2 ][, string $type = 'common' ]) : string|float
- common Normal rounding
- ceil always rounds up
- floor always rounds down
Parameters
- $value : string
- $precision : mixed = 2
- $type : string = 'common'
Return values
string|float —title()
Returns a "title case" version of the string.
public
static title(string $value) : string
Parameters
- $value : string