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 (":"). (Note that a trailing verb without a
leading slash is not permitted).


Templates use the syntax of the API platform; see
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.

public abstract __toString()
  • return string A string representation of the resource template
public abstract match( $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.

  • throws ValidationException if path can't be matched to the template.
  • return array Array matching var names to binding values.
public abstract matches( $path)

Check if $path matches a resource string.

  • return bool
public abstract render(array $bindings)

Renders a resource template using the provided bindings.

  • return string A rendered representation of this resource template.
  • throws ValidationException If $bindings does not contain all required keys or if a sub-template can't be parsed.
© 2020 Bruce Wells
Search Namespaces \ Classes
ConfigurationNumbers (0-9.) only