Skip to content

Commit

Permalink
Updating formatting on doc block for string insert.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 13, 2009
1 parent 6dbb869 commit ca6ca39
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cake/libs/string.php
Expand Up @@ -200,20 +200,21 @@ function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')')
/**
* 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: String::insert(':name is :age years old.', array('name' => 'Bob', '65'));
* Example: `String::insert(':name is :age years old.', array('name' => 'Bob', '65'));`
* Returns: Bob is 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
*
* - 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
*
* @param string $str A string containing variable placeholders
* @param string $data A key => val array where each key stands for a placeholder variable name
* to be replaced with val
* to be replaced with val
* @param string $options An array of options, see description above
* @return string
* @access public
Expand Down

0 comments on commit ca6ca39

Please sign in to comment.