PHP Class ReplaceTokens, symfony-1.4

Example:
;
  
Or:

  
  
  
See also: BaseParamFilterReader
Author: hans lellelid, [email protected]
Inheritance: extends BaseParamFilterReader, implements ChainableReader
Afficher le fichier Open project: vjousse/symfony-1.4 Class Usage Examples

Méthodes publiques

Méthode Description
chain ( Reader $reader ) : object Creates a new ReplaceTokens using the passed in Reader for instantiation.
createToken ( ) : object Adds a token element to the map of tokens to replace.
createTokensource ( ) : object Adds a token source to the sources of this filter.
getBeginToken ( ) : string Returns the "begin token" character.
getEndToken ( ) : the Returns the "end token" character.
getTokens ( ) : array Returns the map of tokens which will be replaced.
getTokensources ( ) : array Returns the token sources used by this filter; used by ReplaceTokens::chain()
read ( $len = null ) : mixed Returns stream with tokens having been replaced with appropriate values.
setBeginToken ( string $beginToken ) Sets the "begin token" character.
setEndToken ( string $endToken ) Sets the "end token" character.
setTokens ( $tokens ) Sets the map of tokens to replace.
setTokensources ( $sources ) Sets the tokensources to use; used by ReplaceTokens::chain()

Private Methods

Méthode Description
_initialize ( ) Initializes tokens and loads the replacee-replacer hashtable.
replaceTokenCallback ( array $matches ) : string Performs lookup on key and returns appropriate replacement string.

Method Details

chain() public méthode

Creates a new ReplaceTokens using the passed in Reader for instantiation.
public chain ( Reader $reader ) : object
$reader Reader
Résultat object A new filter based on this configuration, but filtering the specified reader

createToken() public méthode

Adds a token element to the map of tokens to replace.
public createToken ( ) : object
Résultat object The token added to the map of replacements. Must not be null.

createTokensource() public méthode

Adds a token source to the sources of this filter.
public createTokensource ( ) : object
Résultat object A Reference to the source just added.

getBeginToken() public méthode

Returns the "begin token" character.
public getBeginToken ( ) : string
Résultat string The character used to denote the beginning of a token.

getEndToken() public méthode

Returns the "end token" character.
public getEndToken ( ) : the
Résultat the character used to denote the beginning of a token

getTokens() public méthode

; used by ReplaceTokens::chain()
public getTokens ( ) : array
Résultat array A map (String->String) of token keys to replacement values.

getTokensources() public méthode

Returns the token sources used by this filter; used by ReplaceTokens::chain()
public getTokensources ( ) : array
Résultat array

read() public méthode

If a replacement value is not found for a token, the token is left in the stream.
public read ( $len = null ) : mixed
Résultat mixed filtered stream, -1 on EOF.

setBeginToken() public méthode

Sets the "begin token" character.
public setBeginToken ( string $beginToken )
$beginToken string the character used to denote the beginning of a token.

setEndToken() public méthode

Sets the "end token" character.
public setEndToken ( string $endToken )
$endToken string the character used to denote the end of a token

setTokens() public méthode

; used by ReplaceTokens::chain()
public setTokens ( $tokens )

setTokensources() public méthode

Sets the tokensources to use; used by ReplaceTokens::chain()
public setTokensources ( $sources )