承接 mvccore/ext-form-field-text 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mvccore/ext-form-field-text

Composer 安装命令:

composer require mvccore/ext-form-field-text

包简介

MvcCore - Extension - Form - Field - Text - form field types - input:text, input:email, input:password, input:search, input:tel, input:url and textarea.

README 文档

README

Latest Stable Version License PHP Version

MvcCore form extension with input field types text, email, password, search, tel, url and textarea field.

Installation

composer require mvccore/ext-form-field-text

Fields And Default Validators

  • input:text, input:search
    • SafeString
      • configured by default
      • XSS string protection to safely display submitted value in response, configured by default
    • MinMaxLength
      • not configured by default
      • validation by PHP mb_strlen() for min. and max.
    • Pattern
      • not configured by default
      • validation by PHP preg_match()
  • input:password (extended from input:text)
    • Password
      • not configured by default
      • validation by configurable password strength rules
    • SafeString, MinMaxLength, Pattern - not configured by default, ...description above
  • input:email (extended from input:text)
    • Email
      • configured by default
      • single/multiple email form validation by PHP filter_var($rawValue, FILTER_VALIDATE_EMAIL);
    • SafeString, MinMaxLength, Pattern - not configured by default, ...description above
  • input:tel (extended from input:text)
    • Tel
      • configured by default
      • validation for not allowed chars in phone number, no validation for international phone number form
    • SafeString, MinMaxLength, Pattern - not configured by default, ...description above
  • input:url (extended from input:text)
    • Url
      • configured by default
      • url validation by regular expression, SSRF save value, optional DNS validation and many other options
    • SafeString, MinMaxLength, Pattern - not configured by default, ...description above
  • textarea
    • SafeString - configured by default
    • MinMaxLength, Pattern - not configured by default, ...description above

Features

  • always server side checked attributes required, disabled and readonly
  • all HTML5 specific and global atributes (by Mozilla Development Network Docs)
  • every field has it's build-in specific validator described above
  • every build-in validator adds form error (when necessary) into session and than all errors are displayed/rendered and cleared from session on error page, where user is redirected after submit
  • any field is possible to render naturally or with custom template for specific field class/instance
  • very extensible field classes - every field has public template methods:
    • SetForm() - called immediatelly after field instance is added into form instance
    • PreDispatch() - called immediatelly before any field instance rendering type
    • Render() - called on every instance in form instance rendering process
      • submethods: RenderNaturally(), RenderTemplate(), RenderControl(), RenderLabel() ...
    • Submit() - called on every instance when form is submitted

Examples

Basic Example

$form = (new \MvcCore\Ext\Form($controller))->SetId('demo');
...
$username = new \MvcCore\Ext\Forms\Fields\Text();
$username
	->SetName('username')
	->SetPlaceHolder('User');
$password = new \MvcCore\Ext\Forms\Fields\Password([
	'name'			=> 'password',
	'placeHolder'	=> 'Password',
	'validators'	=> ['Password'],
]);
...
$form->AddFields($username, $password);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-09-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固