wCMF
3.6
|
Public Member Functions | |
getDump ($var) | |
cropString ($text, $length=100, $ending='...', $exact=false, $considerHtml=true) | |
removeTrailingComma ($string) | |
getUrls ($string) | |
quotesplit ($s) | |
splitQuoted ($str, $delim='//', $quoteChr='"', $preserve=false) | |
excerpt ($text, $phrase, $radius=100) | |
StringUtil provides support for string manipulation.
wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH
Licensed under the terms of any of the following licenses at your choice:
See the license.txt file distributed with this work for additional information.
Definition at line 27 of file class.StringUtil.php.
StringUtil::getDump | ( | $var | ) |
Get the dump of a variable as string.
var | The variable to dump. |
Definition at line 34 of file class.StringUtil.php.
Referenced by MultipleActionController\executeKernel(), and Node\filter().
StringUtil::cropString | ( | $text, | |
$length = 100 , |
|||
$ending = '...' , |
|||
$exact = false , |
|||
$considerHtml = true |
|||
) |
Truncate a string up to a number of characters while preserving whole words and HTML tags code from: http://alanwhipple.com/2011/05/25/php-truncate-string-preserving-html-tags-words/
text | String to truncate. |
length | Length of returned string, including ellipsis. |
ending | Ending to be appended to the trimmed string. |
exact | If false, $text will not be cut mid-word |
considerHtml | If true, HTML tags would be handled correctly |
Definition at line 52 of file class.StringUtil.php.
StringUtil::removeTrailingComma | ( | $string | ) |
Remove a trailing comma, if existing.
string | The string to crop |
Definition at line 147 of file class.StringUtil.php.
Referenced by NodeUnifiedRDBMapper\getInsertSQL(), TableUnifiedRDBMapper\getSelectSQL(), NodeUnifiedRDBMapper\getSelectSQL(), NodeUnifiedRDBMapper\getSQLForRefs(), TableUnifiedRDBMapper\getUpdateSQL(), NodeUnifiedRDBMapper\getUpdateSQL(), and FormUtil\translateValue().
StringUtil::getUrls | ( | $string | ) |
Extraxt urls from a string.
string | The string to search in |
Definition at line 158 of file class.StringUtil.php.
Referenced by LinkConverter\convertApplicationToStorage(), LinkConverter\convertStorageToApplication(), and NodeUtil\makeValueUrlsRelative().
StringUtil::quotesplit | ( | $s | ) |
Split a quoted string code from: http://php3.de/manual/de/function.split.php
s | The string to split |
Definition at line 192 of file class.StringUtil.php.
Referenced by InifileParser\processValue().
StringUtil::splitQuoted | ( | $str, | |
$delim = '/ /' , |
|||
$quoteChr = '"' , |
|||
$preserve = false |
|||
) |
Split string preserving quoted strings code based on: http://www.php.net/manual/en/function.explode.php#94024
str | String to split |
delim | Regexp to use in preg_split |
quoteChr | Quote character |
preserve | Boolean whether to preserve the quote character or not |
Definition at line 251 of file class.StringUtil.php.
Referenced by StringQuery\buildQuery().
StringUtil::excerpt | ( | $text, | |
$phrase, | |||
$radius = 100 |
|||
) |
Create an excerpt from the given text around the given phrase code based on: http://stackoverflow.com/questions/1292121/how-to-generate-the-snippet-like-generated-by-google-with-php-and-mysql
Definition at line 271 of file class.StringUtil.php.
Referenced by SearchUtil\find().