ResourceTemplateInterface
interface ResourceTemplateInterface (View source)
internal |
Represents a resource template that may or may not contain a leading slash, and if a leading
slash is present may contain a trailing verb (":
Examples: projects /projects foo/{bar=*}/fizz/ /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
No description
Renders a resource template using the provided bindings.
Check if $path matches a resource string.
Matches a given $path to a resource template, and returns an array of bindings between wildcards / variables in the template and values in the path. If $path does not match the template, then a ValidationException is thrown.
Details
string
__toString()
No description
string
render(array $bindings)
Renders a resource template using the provided bindings.
bool
matches(string $path)
Check if $path matches a resource string.
array
match(string $path)
Matches a given $path to a resource template, and returns an array of bindings between wildcards / variables in the template and values in the path. If $path does not match the template, then a ValidationException is thrown.