Modifier
About 2 min
Modifier
- Full name:
\Hazaar\Template\Smarty\Modifier
Methods
execute
public execute(string $name, mixed $value, mixed $args): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$name | string | |
$value | mixed | |
$args | mixed |
capitalize
public capitalize(string $string): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string |
cat
public cat(): string
count_characters
public count_characters(string $string, bool $include_whitespace = false): int
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$include_whitespace | bool |
count_paragraphs
public count_paragraphs(string $string): int
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string |
count_sentences
Counts the number of sentences in a given string.
public count_sentences(string $string): int
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | the input string to count sentences from |
Return Value:
the number of sentences in the string
count_words
Counts the number of words in a string.
public count_words(string $string): int
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | the input string |
Return Value:
the number of words in the string
date_format
Formats a date using the specified format.
public date_format(mixed $item, null|string $format = null): string
Parameters:
Parameter | Type | Description |
---|---|---|
$item | mixed | The date to format. Can be a string, integer, or DateTime object. |
$format | null|string | The format to use for the date. If not provided, the default format '%c' will be used. |
Return Value:
the formatted date
default
public default(mixed $value, mixed $default = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$value | mixed | |
$default | mixed |
public print(mixed $value): string
Parameters:
Parameter | Type | Description |
---|---|---|
$value | mixed |
dump
public dump(mixed $value): string
Parameters:
Parameter | Type | Description |
---|---|---|
$value | mixed |
export
public export(mixed $value): string
Parameters:
Parameter | Type | Description |
---|---|---|
$value | mixed |
type
public type(mixed $value): string
Parameters:
Parameter | Type | Description |
---|---|---|
$value | mixed |
escape
public escape(string $string, string $format = 'html', string $character_encoding = 'ISO-8859-1'): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$format | string | |
$character_encoding | string |
indent
public indent(string $string, int $length = 4, string $pad_string = ' '): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$length | int | |
$pad_string | string |
lower
public lower(string $string): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string |
nl2br
public nl2br(string $string): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string |
number_format
public number_format(string $string, int $decimals, string $dec_point = '.', string $thousands_sep = ','): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$decimals | int | |
$dec_point | string | |
$thousands_sep | string |
regex_replace
public regex_replace(string $string, string $pattern = '//', string $replacement = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$pattern | string | |
$replacement | string |
replace
public replace(string $string, string $search, string $replace): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$search | string | |
$replace | string |
spacify
public spacify(string $string, string $replacement = ' '): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$replacement | string |
string_format
public string_format(string $string, string $format): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$format | string |
strip
public strip(string $string, string $replacement = ' '): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$replacement | string |
strip_tags
public strip_tags(string $string): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string |
truncate
public truncate(string $string, int $chars = 80, string $text = '...', bool $cut = false, bool $middle = false): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$chars | int | |
$text | string | |
$cut | bool | |
$middle | bool |
upper
public upper(string $string): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string |
wordwrap
public wordwrap(string $string, int $width = 80, string $break = "
", bool $cut = true): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string | string | |
$width | int | |
$break | string | |
$cut | bool |
implode
public implode(mixed $array, string $glue = ''): string
Parameters:
Parameter | Type | Description |
---|---|---|
$array | mixed | |
$glue | string |
Automatically generated on 2024-11-14