PHPackages                             guzzlehttp/uri-template - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. guzzlehttp/uri-template

ActiveLibrary[HTTP &amp; Networking](/categories/http)

guzzlehttp/uri-template
=======================

A polyfill class for uri\_template of PHP

v2.0.0(4w ago)197262.9M—5.4%820MITPHPPHP ^7.4 || ^8.0CI passing

Since Jun 30Pushed 4w ago5 watchersCompare

[ Source](https://github.com/guzzle/uri-template)[ Packagist](https://packagist.org/packages/guzzlehttp/uri-template)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ GitHub Sponsors](https://github.com/Nyholm)[ RSS](/packages/guzzlehttp-uri-template/feed)WikiDiscussions 2.0 Synced 2w ago

READMEChangelog (10)Dependencies (16)Versions (58)Used By (20)

Guzzle URI Template
===================

[](#guzzle-uri-template)

`guzzlehttp/uri-template` expands [RFC 6570](https://datatracker.ietf.org/doc/html/rfc6570) URI templates in PHP. It turns templates such as `/users/{id}{?tab}` into concrete URI strings using values from an array.

Use this package when an API describes paths or links with URI templates. If you only need to send HTTP requests, start with [`guzzlehttp/guzzle`](https://github.com/guzzle/guzzle/blob/8.0/README.md); install this package directly when your application needs URI template expansion.

Installation
------------

[](#installation)

```
composer require guzzlehttp/uri-template
```

Version Guidance
----------------

[](#version-guidance)

VersionStatusPHP Version2.0Latest&gt;=7.4,&lt;8.61.0Maintenance&gt;=7.2.5,&lt;8.6Quick Start
-----------

[](#quick-start)

```
use GuzzleHttp\UriTemplate\UriTemplate;

$uri = UriTemplate::expand('/users/{id}{?tab}', [
    'id' => 123,
    'tab' => 'settings',
]);

echo $uri;
// /users/123?tab=settings
```

The first argument is an RFC 6570 URI template. The second argument is an array of variables. Variable names in the array must match the names used by the template.

Documentation
-------------

[](#documentation)

- [URI Template Usage](docs/uri-template-usage.md)
- [Input Contract](docs/input-contract.md)
- [Upgrade Guide](UPGRADING.md)
- [Changelog](CHANGELOG.md)

Testing
-------

[](#testing)

```
make test
```

Security
--------

[](#security)

If you discover a security vulnerability within this package, please send an email to . All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/uri-template/security/policy) for more information.

License
-------

[](#license)

Guzzle URI Template is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.

For Enterprise
--------------

[](#for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-uri-template?utm_source=packagist-guzzlehttp-uri-template&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

###  Health Score

73

—

ExcellentBetter than 100% of packages

Maintenance94

Actively maintained with recent releases

Popularity71

Solid adoption and visibility

Community35

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 89.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~138 days

Recently: every ~3 days

Total

17

Last Release

29d ago

Major Versions

v0.2.0 → v1.0.02021-08-14

v1.0.10 → 2.0.x-dev2026-07-20

PHP version history (4 changes)v0.1.0PHP ^7.2

v0.2.0PHP ^7.1 || ^8.0

v1.0.0PHP ^7.2.5 || ^8.0

2.0.x-devPHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

![](https://www.gravatar.com/avatar/0e4e105cea62b616d4cb376b08a849b6a428f646998537de150d16a8eb537b90?d=identicon)[mark.sagikazar](/maintainers/mark.sagikazar)

![](https://www.gravatar.com/avatar/d95eb26cb8f3919bb5ca3b6d823daeabbf259663778a970349b245c580713c8e?d=identicon)[graham-campbell](/maintainers/graham-campbell)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (143 commits)")[![gmponos](https://avatars.githubusercontent.com/u/5675248?v=4)](https://github.com/gmponos "gmponos (16 commits)")[![AntoineWattier](https://avatars.githubusercontent.com/u/1131348?v=4)](https://github.com/AntoineWattier "AntoineWattier (1 commits)")

---

Tags

uri-templateguzzlehttp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/guzzlehttp-uri-template/health.svg)

```
[![Health](https://phpackages.com/badges/guzzlehttp-uri-template/health.svg)](https://phpackages.com/packages/guzzlehttp-uri-template)
```

###  Alternatives

[league/uri

URI manipulation library

1.1k252.7M429](/packages/league-uri)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.6k10](/packages/helsingborg-stad-municipio)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

187738.3k49](/packages/laudis-neo4j-php-client)[graze/guzzle-jsonrpc

JSON-RPC 2.0 client for Guzzle

931.2M25](/packages/graze-guzzle-jsonrpc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
