Skip to content

seebz/uri-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uri_template()

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.

About

Implementation of RFC-6570 (Template URI) in a single PHP function

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages