Inheritance diagram for String:

Static Public Member Functions | |
| cleanInsert ($str, $options) | |
| & | getInstance () |
| insert ($str, $data, $options=array()) | |
| tokenize ($data, $separator= ',', $leftBound= '(', $rightBound= ')') | |
| uuid () | |
Definition at line 33 of file string.php.
| String::cleanInsert | ( | $ | str, | |
| $ | options | |||
| ) | [static] |
Cleans up a Set::insert formated string with given $options depending on the 'clean' key in $options. The default method used is text but html is also available. The goal of this function is to replace all whitespace and uneeded markup around placeholders that did not get replaced by Set::insert.
| string | $str | |
| string | $options |
Definition at line 273 of file string.php.
References a().
Referenced by insert().
| & String::getInstance | ( | ) | [static] |
Gets a reference to the String object instance
Definition at line 41 of file string.php.
| String::insert | ( | $ | str, | |
| $ | data, | |||
| $ | options = array() | |||
| ) | [static] |
Replaces variable placeholders inside a $str with any given $data. Each key in the $data array corresponds to a variable placeholder name in $str. Example:
Sample: String::insert('My name is :name and I am :age years old.', array('name' => 'Bob', '65')); Returns: My name is Bob and I am 65 years old.
Available $options are: before: The character or string in front of the name of the variable placeholder (Defaults to ':') after: The character or string after the name of the variable placeholder (Defaults to null) escape: The character or string used to escape the before character / string (Defaults to '\') format: A regex to use for matching variable placeholders. Default is: '/(?<!\)\:s/' (Overwrites before, after, breaks escape / clean) clean: A boolean or array with instructions for String::cleanInsert
| string | $str A string containing variable placeholders | |
| string | $data A key => val array where each key stands for a placeholder variable name to be replaced with val | |
| string | $options An array of options, see description above |
Definition at line 213 of file string.php.
References cleanInsert(), and md5().
Referenced by DboSource::__parseKey(), DboSource::query(), and slug().
| String::tokenize | ( | $ | data, | |
| $ | separator = ',', |
|||
| $ | leftBound = '(', |
|||
| $ | rightBound = ')' | |||
| ) | [static] |
Tokenizes a string using $separator, ignoring any instance of $separator that appears between $leftBound and $rightBound
| string | $data The data to tokenize | |
| string | $separator The token to split the data on |
Definition at line 129 of file string.php.
Referenced by Model::_findList(), Set::classicExtract(), and DboSource::fields().
| String::uuid | ( | ) | [static] |
Generate a random UUID
Definition at line 56 of file string.php.
References $id, env(), and Configure::read().
Referenced by Model::__saveMulti(), Security::generateAuthKey(), and Model::save().
1.4.7