Inheritance diagram for TextHelper:

Public Member Functions | |
| autoLink ($text, $htmlOptions=array()) | |
| autoLinkEmails ($text, $htmlOptions=array()) | |
| autoLinkUrls ($text, $htmlOptions=array()) | |
| excerpt ($text, $phrase, $radius=100, $ending="...") | |
| flay ($text, $allowHtml=false) | |
| highlight ($text, $phrase, $highlighter= '< span class="highlight">\1</span >', $considerHtml=false) | |
| stripLinks ($text) | |
| toList ($list, $and= 'and') | |
| trim () | |
| truncate ($text, $length=100, $ending= '...', $exact=true, $considerHtml=false) | |
Definition at line 45 of file text.php.
| TextHelper::autoLink | ( | $ | text, | |
| $ | htmlOptions = array() | |||
| ) |
Convert all links and email adresses to HTML links.
| string | $text Text | |
| array | $htmlOptions Array of HTML options. |
Definition at line 147 of file text.php.
References autoLinkEmails(), and autoLinkUrls().
| TextHelper::autoLinkEmails | ( | $ | text, | |
| $ | htmlOptions = array() | |||
| ) |
Adds email links (<a href="mailto:....) to a given text.
| string | $text Text | |
| array | $htmlOptions Array of HTML options. |
Definition at line 128 of file text.php.
Referenced by autoLink().
| TextHelper::autoLinkUrls | ( | $ | text, | |
| $ | htmlOptions = array() | |||
| ) |
Adds links (<a href=....) to a given text, by finding text that begins with strings like http:// and ftp://.
| string | $text Text to add links to | |
| array | $htmlOptions Array of HTML options. |
Definition at line 106 of file text.php.
Referenced by autoLink().
| TextHelper::excerpt | ( | $ | text, | |
| $ | phrase, | |||
| $ | radius = 100, |
|||
| $ | ending = "..." | |||
| ) |
Extracts an excerpt from the text surrounding the phrase with a number of characters on each side determined by radius.
| string | $text String to search the phrase in | |
| string | $phrase Phrase that will be searched for | |
| integer | $radius The amount of characters that will be returned on each side of the founded phrase | |
| string | $ending Ending that will be appended |
Definition at line 269 of file text.php.
References truncate().
| TextHelper::flay | ( | $ | text, | |
| $ | allowHtml = false | |||
| ) |
| TextHelper::highlight | ( | $ | text, | |
| $ | phrase, | |||
| $ | highlighter = '<span class="highlight">\1</span>', |
|||
| $ | considerHtml = false | |||
| ) |
Highlights a given phrase in a text. You can specify any expression in highlighter that may include the expression to include the $phrase found.
| string | $text Text to search the phrase in | |
| string | $phrase The phrase that will be searched | |
| string | $highlighter The piece of html with that the phrase will be highlighted | |
| boolean | $considerHtml If true, will ignore any HTML tags, ensuring that only the correct text is highlighted |
| TextHelper::stripLinks | ( | $ | text | ) |
| TextHelper::toList | ( | $ | list, | |
| $ | and = 'and' | |||
| ) |
| TextHelper::trim | ( | ) |
Alias for truncate().
Definition at line 255 of file text.php.
References truncate().
| TextHelper::truncate | ( | $ | text, | |
| $ | length = 100, |
|||
| $ | ending = '...', |
|||
| $ | exact = true, |
|||
| $ | considerHtml = false | |||
| ) |
Truncates text.
Cuts a string to the length of $length and replaces the last characters with the ending if the text is longer than length.
| string | $text String to truncate. | |
| integer | $length Length of returned string, including ellipsis. | |
| mixed | $ending If string, will be used as Ending and appended to the trimmed string. Can also be an associative array that can contain the last three params of this method. | |
| boolean | $exact If false, $text will not be cut mid-word | |
| boolean | $considerHtml If true, HTML tags would be handled correctly |
Definition at line 163 of file text.php.
References Helper::$tags, and a().
1.4.7