Format
class Format
Format Library which allows a country specific formatting of numbers and dates and various other format functions
Constants
FORMAT_MARKDOWN |
|
FORMAT_REVERSE_MARKDOWN |
|
FORMAT_PLAINTEXT |
|
FORMAT_MISC |
|
Properties
static MarkdownExtra_Parser_xf | $markdown_static | ||
static Markdownify_Extra | $reverse_markdown_static | ||
static | $Numbers_Words | ||
static | $regex_match_links |
Methods
No description
Parse links
No description
No description
builds a callable telephone number from given string.
converts letters in given telephone number to corresponding numbers
Formats the output for a table cell - if empty a NBSP is returned
Formats a boolean value
No description
No description
No description
Formats a date
Formats a date time
Format Duration
No description
Format file size
No description
Returns a well formatted HTML of the passed tags with special formatting of the hashtags
Highlight Passed Text using a Syntax Highlighter Engine
No description
Formats a money amount
Formats a number according to local standards and options
Formats a number to be used in javascript (replace ',' with '.' and remove any spaces
Formats a percent value
Formats an rrule to a verbose label
No description
No description
No description
Format Text String e.g. with Markdown
Formats a text to be included in javascript
Formats a time
Formats a timespan between two dates
Takes a numeric input and returns an rendered XUI_USERLINK
Formats a get_tag_cloud() return using different font-sizes
No description
DEPRECATED - Please use >image_resize_parse
Adds XF image resize params to each image in the passed HTML string e.g. will be replaced to:
Callback for image_resize_parse
Checks the given string for utf-8 encoding.
Checks if the last character is or isnt a space. (does it the normal way if it is) It explodes the string into an array of seperate words, the effect is... it chops off anything after and including the last space.
Parst einen Text
Converts a currency value to word representation (1.02 => one dollar two cents) If the number has not any fraction part, the "cents" number is omitted.
Universal formatting function uses option array for further parameters Can be used for providing flexible formatting options within other components
No description
No description
Converts a number to its word representation
Converts a string to the corresponding number using the local number settings
Parst einen Text
Parses the passed text
No description
Details
at line 31
__construct()
No description
at line 1540
string
_link_parse(array $matches)
Parse links
Internal links remain unchanged. External links are modified by prepend a redirect.
at line 1517
_link_parse_markdown($matches)
No description
at line 1489
_text_pre_parse_links($matches)
No description
at line 1737
string
build_telephone_number(string $number, $country = false, $alphanumeric = true)
builds a callable telephone number from given string.
Prefixes country code based on given $country (valid strings are in tbl|system_lib_country). Example: $number = "0172 / 123-456", $contry = "Germany" returns: $number = "+49172123456"
at line 1812
string
convert_letters_to_telephone_number($number, $key_pad = 'INT_STANDARD')
converts letters in given telephone number to corresponding numbers
at line 585
empty2nbsp($value)
Formats the output for a table cell - if empty a NBSP is returned
at line 551
string
format_boolean($input, $options = array())
Formats a boolean value
at line 502
mixed
format_by_callback(mixed $input, mixed $options = array())
No description
at line 417
format_cast($input, $type)
No description
at line 425
format_contrast_color($hexcolor, $dark = 'black', $light = 'white')
No description
at line 712
string
format_date(bool|int $input = false, array $options = array())
Formats a date
at line 825
string
format_datetime(int $input, array $options = array())
Formats a date time
at line 619
format_duration($seconds, mixed $options = array())
Format Duration
at line 1052
format_email($input, $options = array())
No description
at line 518
string
format_filesize($input, array $options = [])
Format file size
at line 770
format_friendly_date($date, $dateformat = '%x %R', $options = array())
No description
at line 1465
string|string[]|null
format_hashtags(mixed $text_with_hashtags)
Returns a well formatted HTML of the passed tags with special formatting of the hashtags
at line 129
mixed|string
format_highlight_syntax(mixed $text, string $format = 'auto')
Highlight Passed Text using a Syntax Highlighter Engine
at line 538
string
format_insert(string $input, string $target)
No description
at line 935
string
format_money(float $input, $options = array())
Formats a money amount
at line 967
array|float|string
format_number(float $input, array $options = array())
Formats a number according to local standards and options
at line 1106
string
format_number_js($input)
Formats a number to be used in javascript (replace ',' with '.' and remove any spaces
at line 599
string
format_percent(float $input, $options = array())
Formats a percent value
at line 1080
string
format_rrule(string $rrule)
Formats an rrule to a verbose label
at line 439
format_sprintf(mixed $input, mixed $parameters)
No description
at line 460
string
format_string($string, bool $apply_gettext = true)
No description
at line 1512
format_template_specialchars($text)
No description
at line 55
mixed|string
format_text(string $text, string $style = Format::FORMAT_MARKDOWN, array $options = array())
Format Text String e.g. with Markdown
Possible Options:
- markdown:
- allow_html (true|false)
- entity_decoding (true - use true if converting HTML to plaintext e.g. for email or SMS | false - use false for sanitizing)
at line 1117
string
format_text_js(string $input)
Formats a text to be included in javascript
at line 684
string
format_time(int $input, array $options = array())
Formats a time
at line 892
string
format_timespan(array $input, array $options = array())
Formats a timespan between two dates
at line 395
bool|string
format_userlink($id)
Takes a numeric input and returns an rendered XUI_USERLINK
at line 1257
string
get_formatted_tag_cloud(array $tag_cloud_array, array $link_params, array $options = array(), Link $xf_link = null)
Formats a get_tag_cloud() return using different font-sizes
at line 1659
mixed|string
highlight_search_words(string $subject, array $words, bool $alphanumeric = true)
No description
at line 1591
string
html_to_imgresized(string $html)
DEPRECATED - Please use >image_resize_parse
at line 1602
string
image_resize_parse(string $html)
Adds XF image resize params to each image in the passed HTML string e.g. will be replaced to:
at line 1610
image_resize_parse_cb(mixed $matches)
Callback for image_resize_parse
at line 1693
bool
is_utf8($str)
Checks the given string for utf-8 encoding.
at line 221
string
limit_string(string $string, int $charlimit = 200)
Checks if the last character is or isnt a space. (does it the normal way if it is) It explodes the string into an array of seperate words, the effect is... it chops off anything after and including the last space.
at line 1565
string
link_parse(string $text)
Parst einen Text
at line 1232
string
money_to_str(float $money_float, string $int_curr = '')
Converts a currency value to word representation (1.02 => one dollar two cents) If the number has not any fraction part, the "cents" number is omitted.
at line 272
string
multi_format(float $input, array $options)
Universal formatting function uses option array for further parameters Can be used for providing flexible formatting options within other components
Example Format $options['format']="money"; $options['options']['decimals']=2; $options['suffix']=" EUR";
at line 237
array|mixed
multi_format_array(array $input_array, array $options, $type = '2dim')
No description
at line 379
string
multi_format_queue(mixed $input, $format_queue)
No description
at line 1207
string
number_to_str(int $number)
Converts a number to its word representation
at line 1181
str_to_number($string)
Converts a string to the corresponding number using the local number settings
at line 1389
string
text_parse(string $text, bool $nl2br = true, bool $parse_hash_tags = false)
Parst einen Text
at line 1483
text_pre_parse($text)
Parses the passed text
at line 1187
wiki_parse($text)
No description