Reference documentation and code samples for the Google API Core Client class PathTemplate.
Represents a path template.
Templates use the syntax of the API platform; see the protobuf of HttpRule 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 PathTemplate, which can then be used to perform matching and instantiation.
Namespace
Google \ ApiCore
Methods
__construct
PathTemplate constructor.
Parameter
Name
Description
path
string
A path template string
__toString
Returns
Type
Description
string
A string representation of the path template
render
Renders a path template using the provided bindings.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google API Core Client - Class PathTemplate (1.36.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.36.1 (latest)](/php/docs/reference/gax/latest/PathTemplate)\n- [1.36.0](/php/docs/reference/gax/1.36.0/PathTemplate)\n- [1.35.1](/php/docs/reference/gax/1.35.1/PathTemplate) \nReference documentation and code samples for the Google API Core Client class PathTemplate.\n\nRepresents a path template.\n\nTemplates use the syntax of the API platform; see the protobuf of HttpRule for\ndetails. A template consists of a sequence of literals, wildcards, and variable bindings,\nwhere each binding can have a sub-path. A string representation can be parsed into an\ninstance of PathTemplate, which can then be used to perform matching and instantiation.\n\nNamespace\n---------\n\nGoogle \\\\ ApiCore\n\nMethods\n-------\n\n### __construct\n\nPathTemplate constructor.\n\n### __toString\n\n### render\n\nRenders a path template using the provided bindings.\n\n### matches\n\nCheck if $path matches a resource string.\n\n### match\n\nMatches a fully qualified path template string."]]