class AbsoluteResourceTemplate implements ResourceTemplateInterface

Represents an absolute resource template, meaning that it will always contain a leading slash, and may contain a trailing verb (":").

Examples: /projects /projects/{project} /foo/{bar=**}/fizz/*:action

Templates use the syntax of the API platform; see https://github.com/googleapis/api-common-protos/blob/master/google/api/http.proto for details. A template consists of a sequence of literals, wildcards, and variable bindings, where each binding can have a sub-path. A string representation can be parsed into an instance of AbsoluteResourceTemplate, which can then be used to perform matching and instantiation.

Methods

__construct(string $path)

AbsoluteResourceTemplate constructor.

string
__toString()

No description

string
render(array $bindings)

No description

bool
matches(string $path)

No description

array
match(string $path)

No description

Details

at line 65
__construct(string $path)

AbsoluteResourceTemplate constructor.

Parameters

string $path

Exceptions

ValidationException

at line 83
string __toString()

Return Value

string A string representation of the resource template

at line 91
string render(array $bindings)

Parameters

array $bindings An array matching var names to binding strings.

Return Value

string A rendered representation of this resource template.

at line 99
bool matches(string $path)

Parameters

string $path A resource string.

Return Value

bool

at line 112
array match(string $path)

Parameters

string $path A resource string.

Return Value

array Array matching var names to binding values.