\GuzzleHttpUriTemplate

Expands URI templates. Userland implementation of PECL uri_template.

Summary

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

Properties

$template

$template : string

Type

string — URI template

$variables

$variables : array

Type

array — Variables to use in the template expansion

$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(  $template, array  $variables) 

Parameters

$template
array $variables

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.

This makes the assumption that input arrays are sequences or hashes. This assumption is a tradeoff for accuracy in favor of speed, but it should work in almost every case where input is supplied for a URI template.

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