toxygene/simple-uri-template 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

toxygene/simple-uri-template

最新稳定版本:2.0.3

Composer 安装命令:

composer require toxygene/simple-uri-template

包简介

README 文档

README

A simple URI template language with a lexer and parsers to output a regular expression or a complete URI.

The primary use case is for assembling and matching path-based routes.

Installation

composer install toxygene/simple-uri-template

Language Definition

   TEMPLATE ::= ( PLACEHOLDER | LITERAL ) { TEMPLATE } *
PLACEHOLDER ::= "{" IDENTIFIER "}"
 IDENTIFIER ::= [a-zA-Z][a-zA-Z0-9]*
    LITERAL ::= [^{}]+

Regex Examples

use Toxygene\SimpleUriTemplate\Lexer;
use Toxygene\SimpleUriTemplate\RegexParser;

$lexer = new Lexer();
$parser = new RegexParser($lexer);

echo $parser->parse('/one/{two}/three'); // #^/one/(?P<two>.+?)/three$#

URI Examples

use Toxygene\SimpleUriTemplate\Lexer;
use Toxygene\SimpleUriTemplate\UriParser;

$lexer = new Lexer();
$parser = new UriParser($lexer);

echo $parser->parse('/one/{two}/three', ['two' => 2]); // /one/2/three

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-08-27