2017 © Pedro Peláez
 

library html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

image

jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  • Saturday, February 17, 2018
  • by jenwachter
  • Repository
  • 3 Watchers
  • 7 Stars
  • 2,658 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 5 Open issues
  • 15 Versions
  • 8 % Grown

The README.md

HTML Form

Hate writing and validating HTML forms? Me too. The HTML Form library was designed to make creating, validating, and maintaining forms easier., (*1)

Requirements

  1. PHP >= 5.3.2
  2. Sessions enabled (if you want the form fields to repopulate)

Installation

Via Composer:, (*2)

{
    "require": {
        "jenwachter/html-form": "0.3.*"
    }
}

Documentation

See below for basic usage or see the wiki., (*3)

Basic Usage


// Create the form $form = new \HtmlForm\Form(); // Add a fieldset $fieldset = $form->addFieldset("Contact info"); // Add some form fields $fieldset->addTextbox("name", "Your name", array("required" => true)) ->addEmail("email", "Your email", array("required" => true)) ->addNumber("age", "Your age") ->addSelect("gender", "Your gender", array("male", "female")); $form->addSubmit("submit", "Submit"); // Render the form $form->display(); // Validate the form if (isset($_POST["submit"]) && $form->isValid()) { // continue processing the form as you see fit }

Changelog

  • 0.8
    • Added server-side validation for maxlength attribute
  • 0.7
    • Moved location of help text to after label for accessibility
  • 0.6.2
    • Added htmlspecialchars method
  • 0.6.1
    • Bugfix
  • 0.6
    • Added striptags sanitizer
  • 0.5
    • Moved validation functions into element classes.
    • Added sanitizer class
  • 0.4
    • Removed $_GET support
    • Improved unit tests
  • 0.3.3
    • Removed label from honeypot
  • 0.3.2
    • Removed rendering of global beforeElement and afterElement content before and after bits of HTML.
  • 0.3.1
    • Bug fix
  • 0.3, (*4)

    • Added a flag that allows option form fields to use the numeric keys of the options array as the option field's value. Issue #13
  • 0.2, (*5)

    • Method name changes in HtmlForm\Form:
    • render() is now display()
    • compileForm() is now render()
  • 0.1
    • Initial release

The Versions

17/02 2018

dev-master

9999999-dev http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

form validation

05/01 2018

v0.8

0.8.0.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

form validation

13/07 2017

0.7

0.7.0.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

form validation

07/02 2017

dev-develop

dev-develop http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

form validation

07/02 2017

0.6.2

0.6.2.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

form validation

22/09 2016

0.6.1

0.6.1.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

form validation

20/09 2016

0.6

0.6.0.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

form validation

20/09 2016

0.5

0.5.0.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

form validation

16/09 2016

0.4

0.4.0.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

form validation

13/07 2016

0.3.3

0.3.3.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

form validation

09/07 2015

0.3.2

0.3.2.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

form validation

02/07 2013

0.3.1

0.3.1.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

form validation

21/06 2013

0.3

0.3.0.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

form validation

20/05 2013

0.2

0.2.0.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

form validation

09/05 2013

0.1

0.1.0.0 http://github.com/jenwachter/html-form

A PHP library designed to make creating, validating, and maintaining forms easier.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

form validation