承接 jmversteeg/fieldwork 相关项目开发

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

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

jmversteeg/fieldwork

最新稳定版本:4.3.0

Composer 安装命令:

composer require jmversteeg/fieldwork

包简介

Web forms for cool people

README 文档

README

Web forms for cool people

Build Status Code Quality Code Coverage

fieldwork will make your life easier by dealing with the trivial tasks of building web forms such as markup generation, validation and sanitization.

  • Define entire forms using PHP only. All HTML and JavaScript code will be generated for you.
  • Sanitizes and validates client-side for convenience + performance and server-side for security.

Creating a simple form

use fieldwork\Form;
use fieldwork\components\TextField;
use fieldwork\components\Button;
use fieldwork\validators\EmailFieldValidator;

// Instantiate a new form
$contactForm = new Form('contactform');

// Add a text field with validation
$emailField = new TextField('email', 'Email address');
$emailField
   ->addValidator(new EmailFieldValidator())
   ->addTo($contactForm);

// Add a submit button
$submitButton = new Button('submit', 'Send', 'submit', Button::TYPE_SUBMIT);
$submitButton
   ->addTo($contactForm);

// Process the form
$contactForm->process();

if($contactForm->isSubmitted())
    echo 'Your email address is ' . $contactForm->v('email');
else
    echo $contactForm->getHTML();

TODO

  • Error message i18n
  • Tighter AJAX integration / API
  • Complete test coverage

HEAD

  • Moved the front-end assets into a separate repo
  • Added NumberSanitizer
  • Added materialize.css compatible markup generation
  • Fixed some bugs

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-23