dev-master
9999999-dev http://github.com/iamapinan/phpclass-form-generaterphp class for html form generater
Apache License
The Requires
- php 5.4.0
form generate html5
php class for html form generater
This script will auto generate HTML output and it very easy to use and work with bootstrap framwork., (*2)
Download stable version, (*3)
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();
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>');
"text" "password" "email" "file" "date" "datetime" "month" "color" "number" "range" "search" "tel" "time" "url" "week" "radio" "checkbox" "button" "submit" "select" "textarea"
Email iamapinan@gmail.com, (*10)
Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0, (*11)
php class for html form generater
Apache License
form generate html5