1. Go to this page and download the library: Download pablosanches/form-builder library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pablosanches / form-builder example snippets
use FormBuilder\Builder;
$builder = new FormBuilder\Builder();
$builder = new FormBuilder\Builder('http://submit-here.com');
// Add a new form action
$builder->set('action', 'http://submit-here.com');
// Change the submit method
$builder->set('method', 'get');
// Change the enctype
$builder->set('enctype', 'multipart/form-data');
// Can be set to 'html' or 'xhtml'
$builder->set('markup', 'xhtml');
// Classes are added as an array
$builder->set('class', array());
// Add an id to the form
$builder->set('id', 'xhtml');
// Adds the HTML5 "novalidate" attribute
$builder->set('novalidate', true);
// Adds a WordPress nonce field using the string being passed
$builder->set('add_nonce', 'build_a_nonce_using_this');
// Adds a blank, hidden text field for spam control
$builder->set('add_honeypot', true);
// Wraps the inputs with a form element
$builder->set('form_element', true);
// If no submit type is added, add one automatically
$builder->set('form_element', true);
$builder->addInput('I am a little field', array(), 'little_field')
$builder->buildForm();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.