定制 honda/url-pattern-matcher 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

honda/url-pattern-matcher

Composer 安装命令:

composer require honda/url-pattern-matcher

包简介

Check if a given path matches a given pattern.

README 文档

README

Tests Formats Version Total Downloads License

Checks if a given path like (/articles/4) matches a given pattern like (/articles/*).

Installation

You can install the package via composer:

composer require honda/url-pattern-matcher

Usage

Trailing forward slashes are ignored so the matcher will match /example, example, example/, /example/ if given /example.

use Honda\UrlPatternMatcher\UrlPatternMatcher;
$urlPatternMatcher = new UrlPatternMatcher('/articles/edit');

$urlPatternMatcher->match('/articles');

// See fnmatch() function for reference on how the matching works.
$urlPatternMatcher->match('/articles/*/edit');

// Matches if the path starts with /articles
$urlPatternMatcher->match('^/articles');

// Matches if the path ends with /articles
$urlPatternMatcher->match('/articles$');

Testing

There is 100% code coverage for this package, it's rare, most of the time useless, but it feels good :)

composer test

Url Pattern Matcher was created by Félix Dorn under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固