seebz / uri-template
Implementation of RFC 6570 (URI Template) in a single PHP function
1.1.0
2018-02-22 13:25 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- php: >=5.6.0
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2026-03-19 12:25:27 UTC
README
Implementation of RFC 6570 (URI Template) in a single PHP function.
Installation
Install the latest version with composer:
$ composer require seebz/uri-template
Usage
<?php
require 'vendor/autoload.php';
$template = 'https://api.github.com/repos{/user,repo,function,id}';
$variables = array(
'user' => 'Seebz',
'repo' => 'uri-template',
'function' => 'commits',
);
$uri = uri_template($template, $variables);
// "https://api.github.com/repos/Seebz/uri-template/commits"
License
Simply do what the fuck you want.