marionnewlevant/match-input 问题修复 & 功能扩展

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

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

marionnewlevant/match-input

最新稳定版本:2.0.1

Composer 安装命令:

composer require marionnewlevant/match-input

包简介

Craft field type for text fields that match a regex pattern

README 文档

README

Craft field type for text fields that match a regex pattern.

Installation

To install Match Input, follow these steps:

  1. Install with Composer via composer require marionnewlevant/match-input from your project directory
  2. Install plugin in the Craft Control Panel under Settings > Plugins

or

  1. Install via the Plugin Store

Match Input works on Craft 3.x.

Match Input Overview

A Match Input field is a Plain Text field with the addition of a regex pattern that the field must match to be valid.

Using Match Input

When you create the field, you specify the Input Mask. This is the PCRE Pattern which the input is required to match. You also specify an Error Message to display when the field does not match the pattern.

If you need to translate the Error Message (for a multi-language control panel), those translations will be in the site translation category.

Sample Input Masks

  • https:// - not a valid pattern (no delimiters)
  • /https:\/\// - valid pattern, will match string with https:// in it anywhere
  • #https://# - valid pattern, will match string with https:// in it anywhere (sometimes / isn't the best delimiter)
  • #^https://# - will match string that begins with https://
  • /^\d{5}(-\d{4})?$/ - will match 5 digits, optionally followed by - and 4 digits (uses ^ and $ to match the entire string)

Acknowledgements

Brought to you by Marion Newlevant. Icon interior by SlideGenius from the Noun Project

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-19