2017 © Pedro PelĂĄez
 

library wtforms

WTForms for PHP

image

osoobe/wtforms

WTForms for PHP

  • Wednesday, December 30, 2015
  • by b4oshany
  • Repository
  • 0 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

wtforms-php

PHP Forms library inspired in python wtforms, (*1)

Installing WTForms-PHP

There are two ways to get WTForms-PHP, i.e. by composer install or download the package manually., (*2)

Get WTForms-PHP via composer

You can run the following terminal command in the root directory of your project:, (*3)

composer install wtforms\wtforms

or add the the following lines to your composer.json file as a requirement:, (*4)

wtforms\wtforms: 1.0

Get WTForms-PHP via download

You can download the latest version of the project here, (*5)

Using WTForms-PHP in your project

If your using composer with autoloading, you can simple use the WTForms namespace to load specific classes or modules from the WTForms-PHP library. For instance:, (*6)

use WTForms\Form;
use WTForms\Fields\StringField;

Otherwise, you have to manually include them by doing the following:, (*7)

require_once 'path/to/wtforms-php/src/Form.php';
require_once 'path/to/wtforms-php/src/fields/StringField.php';

Create a WTForm Object

The example below is used to create form object with a list of form input fields., (*8)

class AddressForm extends Form{
    function setUp(){
        $this->_fields = [
            "street" => (new Fields\StringField("Street")),
            "town" => (new Fields\StringField("Town/District"))->required(),
            "parish" => (new Fields\StringField("Parish"))->required(),
            "country" => (new Fields\StringField("Country"))->required(),
        ]
    }
}

The Versions

30/12 2015

dev-master

9999999-dev https://github.com/b4oshany/wtforms-php

WTForms for PHP

  Sources   Download

LGPLv2

The Requires

 

The Development Requires

php forms wtforms

30/12 2015

v1.2

1.2.0.0 https://github.com/b4oshany/wtforms-php

WTForms for PHP

  Sources   Download

LGPLv2

The Requires

 

The Development Requires

php forms wtforms

30/08 2015

v1.1

1.1.0.0 https://github.com/b4oshany/wtforms-php

WTForms for PHP

  Sources   Download

LGPLv2

The Requires

 

The Development Requires

php forms wtforms

12/08 2015

v1.0

1.0.0.0 https://github.com/b4oshany/wtforms-php

WTForms for PHP

  Sources   Download

LGPLv2

The Requires

 

The Development Requires

php forms wtforms