PHP Class Devise\Support\Str

显示文件 Open project: devisephp/cms

Public Methods

Method Description
replaceBetween ( string $haystack, string $needle, Closure $replacementMethod ) : string Replace the $needle strings within the $haystack with whatever the $replacementMethod tells us. Replacement method will be given a $between variable

Protected Methods

Method Description
closetag ( string $str ) : char Gets the closing tag for a string
escaped ( string $str ) : integer Gets escaped string. If the string has '\' char then it is considered to be escaped.
opentag ( string $str ) : char Gets opening tag for a string

Method Details

closetag() protected method

Gets the closing tag for a string
protected closetag ( string $str ) : char
$str string
return char

escaped() protected method

..
protected escaped ( string $str ) : integer
$str string
return integer

opentag() protected method

Gets opening tag for a string
protected opentag ( string $str ) : char
$str string
return char

replaceBetween() public method

Usage: replaceBetween('something @here(...) and @here(...)', '@here', function($between) { return "[ $between ]";" }); Returns something [ ... ] and [ ... ] This method is used by Devise\Pages\Docs\LiveSpan.
public replaceBetween ( string $haystack, string $needle, Closure $replacementMethod ) : string
$haystack string
$needle string
$replacementMethod Closure
return string