String Class Reference

Inheritance diagram for String:

Object List of all members.

Static Public Member Functions

 cleanInsert ($str, $options)
getInstance ()
 insert ($str, $data, $options=array())
 tokenize ($data, $separator= ',', $leftBound= '(', $rightBound= ')')
 uuid ()

Detailed Description

Definition at line 33 of file string.php.


Member Function Documentation

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.

Parameters:
string $str
string $options
Returns:
string public

Definition at line 273 of file string.php.

References a().

Referenced by insert().

& String::getInstance (  )  [static]

Gets a reference to the String object instance

Returns:
object String instance public

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

Parameters:
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
Returns:
string public

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

Parameters:
string $data The data to tokenize
string $separator The token to split the data on
Returns:
array public

Definition at line 129 of file string.php.

Referenced by Model::_findList(), Set::classicExtract(), and DboSource::fields().

String::uuid (  )  [static]

Generate a random UUID

See also:
http://www.ietf.org/rfc/rfc4122.txt
Returns:
RFC 4122 UUID

Definition at line 56 of file string.php.

References $id, env(), and Configure::read().

Referenced by Model::__saveMulti(), Security::generateAuthKey(), and Model::save().


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:57 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7