\Guzzle\Parser\UriTemplateUriTemplate

Expands URI templates using an array of variables

Summary

Methods
Properties
Constants
expand()
setRegex()
No public properties found
DEFAULT_PATTERN
No protected methods found
No protected properties found
N/A
parseExpression()
expandMatch()
isAssoc()
decodeReserved()
$template
$variables
$regex
$operatorHash
$delims
$delimsPct
N/A

Constants

DEFAULT_PATTERN

DEFAULT_PATTERN = '/\{([^\}]+)\}/'

Properties

$template

$template : string

Type

string — URI template

$variables

$variables : array

Type

array — Variables to use in the template expansion

$regex

$regex : string

Type

string — Regex used to parse expressions

$operatorHash

$operatorHash : array

Type

array — Hash for quick operator lookups

$delims

$delims : array

Type

array — Delimiters

$delimsPct

$delimsPct : array

Type

array — Percent encoded delimiters

Methods

expand()

expand(string  $template, array  $variables) : string

Expand the URI template using the supplied variables

Parameters

string $template

URI Template to expand

array $variables

Variables to use with the expansion

Returns

string —

Returns the expanded template

setRegex()

setRegex(string  $regexPattern) 

Set the regex patten used to expand URI templates

Parameters

string $regexPattern

parseExpression()

parseExpression(string  $expression) : array

Parse an expression into parts

Parameters

string $expression

Expression to parse

Returns

array —

Returns an associative array of parts

expandMatch()

expandMatch(array  $matches) : string

Process an expansion

Parameters

array $matches

Matches met in the preg_replace_callback

Returns

string —

Returns the replacement string

isAssoc()

isAssoc(array  $array) : boolean

Determines if an array is associative

Parameters

array $array

Array to check

Returns

boolean

decodeReserved()

decodeReserved(string  $string) : string

Removes percent encoding on reserved characters (used with + and # modifiers)

Parameters

string $string

String to fix

Returns

string