innmind/url-template
最新稳定版本:3.1.0
Composer 安装命令:
composer require innmind/url-template
包简介
Url template expansion processor
关键字:
README 文档
README
RFC6570 implementation.
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).
统计信息
- 总下载量: 19.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-06