2017 © Pedro Peláez
 

library phpclass-form-generater

php class for html form generater

image

phpclass-form-generater/phpclass-form-generater

php class for html form generater

  • Tuesday, August 8, 2017
  • by iamapinan
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

About PHP HTML Generater

Build Status, (*1)

This script will auto generate HTML output and it very easy to use and work with bootstrap framwork., (*2)

Download stable version, (*3)

How to use.

Using step start with create form object., (*4)

$frm = new form;, (*5)

Before start you must assign form object and configuration to $frm->form_object. Below is example of use., (*6)

$frm = new form;
$frm->form_object = array(
  1=>array(
    "type"=>"text",
    "label"=>"Your name",
    "name"=>"fullname",
    "class"=>"form-control",
    "value"=>"John Doe",
    "placeholder"=>"Firstname Lastname"
  ),
  2=>array(
    "type"=>"select",
    "label"=>"Age",
    "name"=>"age",
    "class"=>"form-control",
    "data"=>array(
      "1-10"=>"1-10",
      "11-20"=>"11-20",
      "21-30"=>"21-30"
    )
  ),
  3=>array(
    "type"=>"checkbox",
    "label"=>"Agree to term of services",
    "name"=>"agree",
    "attribute"=>"checked",
    "class"=>"checkbox"
  ),
  4=>array(
    "type"=>"submit",
    "class"=>"btn btn-primary btn-large",
    "value"=>"Submit"
  ),
);

// Sample alert dialog.
$alert = $frm->alert_dialog('success','Test Message');
$frm->add_custom_object($alert);
$frm->form_start();
$frm->set_form_object();
$frm->form_finish();

// Render the form.
echo $frm->form_render();

Special method.

alert_dialog this method will return alert component from bootstrap alert., (*7)

$frm->alert_dialog('return type','Test Message');

Return type support is like bootstrap alert type., (*8)

add_custom_object this method use when you need to add your own form object or html code to the form., (*9)

$frm->add_custom_object('<p>My Example HTML Code</p>');

Form input type supported.

"text"
"password"
"email"
"file"
"date"
"datetime"
"month"
"color"
"number"
"range"
"search"
"tel"
"time"
"url"
"week"
"radio"
"checkbox"
"button"
"submit"
"select"
"textarea"

Developer

Email iamapinan@gmail.com, (*10)

Apache License

Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0, (*11)

The Versions

08/08 2017

dev-master

9999999-dev http://github.com/iamapinan/phpclass-form-generater

php class for html form generater

  Sources   Download

Apache License

The Requires

  • php 5.4.0

 

form generate html5