Zend Framework  3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Token Class Reference

Public Member Functions

 __construct ($tokens=[], $prefix= '', $suffix= '')
 Token Processor walks through a Config structure and replaces all occurrences of tokens with supplied values.
 
 setPrefix ($prefix)
 
 getPrefix ()
 
 setSuffix ($suffix)
 
 getSuffix ()
 
 setTokens ($tokens)
 Set token registry.
 
 getTokens ()
 Get current token registry.
 
 addToken ($token, $value)
 Add new token.
 
 setToken ($token, $value)
 Add new token.
 
 process (Config $config)
 Process.
 
 processValue ($value)
 Process a single value.
 

Protected Member Functions

 buildMap ()
 Build replacement map.
 

Protected Attributes

 $prefix = ''
 
 $suffix = ''
 
 $tokens = []
 
 $map = null
 

Constructor & Destructor Documentation

__construct (   $tokens = [],
  $prefix = '',
  $suffix = '' 
)

Token Processor walks through a Config structure and replaces all occurrences of tokens with supplied values.

Parameters
array | Config | Traversable$tokensAssociative array of TOKEN => value to replace it with
string$prefix
string$suffix
Returns
Token

Member Function Documentation

addToken (   $token,
  $value 
)

Add new token.

Parameters
string$token
mixed$value
Returns
Token
Exceptions
Exception\InvalidArgumentException
buildMap ( )
protected

Build replacement map.

Returns
array
getPrefix ( )
Returns
string
getSuffix ( )
Returns
string
getTokens ( )

Get current token registry.

Returns
array
process ( Config  $config)

Process.

Parameters
Config$config
Returns
Config
Exceptions
Exception\InvalidArgumentException

Implements ProcessorInterface.

processValue (   $value)

Process a single value.

Parameters
$value
Returns
mixed

Implements ProcessorInterface.

setPrefix (   $prefix)
Parameters
string$prefix
Returns
Token
setSuffix (   $suffix)
Parameters
string$suffix
Returns
Token
setToken (   $token,
  $value 
)

Add new token.

Parameters
string$token
mixed$value
Returns
Token
setTokens (   $tokens)

Set token registry.

Parameters
array | Config | Traversable$tokensAssociative array of TOKEN => value to replace it with
Returns
Token
Exceptions
Exception\InvalidArgumentException

Member Data Documentation

$map = null
protected
$prefix = ''
protected
$suffix = ''
protected
$tokens = []
protected