2017 © Pedro Peláez
 

library url-template

Url template expansion processor

image

innmind/url-template

Url template expansion processor

  • Sunday, May 6, 2018
  • by Baptouuuu
  • Repository
  • 0 Watchers
  • 2 Stars
  • 13 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

UrlTemplate

Build Status codecov Type Coverage, (*1)

RFC6570 implementation., (*2)

Installation

composer require innmind/url-template

Usage

use Innmind\UrlTemplate\Template;
use Innmind\Immutable\Map;
use Innmind\Url\Url;

$url = Template::of('http://example.com/dictionary/{term:1}/{term}')->expand(
    Map::of(['term', 'dog']),
);
$url instanceof Url; // true
$url->toString(); // http://example.com/dictionary/d/dog

$variables = Template::of('http://example.com/dictionary/{term:1}/{term}')->extract(
    Url::of('http://example.com/dictionary/d/dog')
);
$variables; // Map<string, string>
$variables->size(); // 1
$variables->get('term'); // dog

Important: variable extraction is not supported for list (ie {foo*} expression)., (*3)

The Versions

06/05 2018

dev-master

9999999-dev http://github.com/Innmind/UrlTemplate

Url template expansion processor

  Sources   Download

MIT

The Requires

 

The Development Requires

rfc6570 url template

06/05 2018

1.0.0

1.0.0.0 http://github.com/Innmind/UrlTemplate

Url template expansion processor

  Sources   Download

MIT

The Requires

 

The Development Requires

rfc6570 url template

06/05 2018

dev-develop

dev-develop http://github.com/Innmind/UrlTemplate

Url template expansion processor

  Sources   Download

MIT

The Requires

 

The Development Requires

rfc6570 url template