Php Form Builder's public Functions reference

General

__construct
$form = new Form($form_ID, $layout = 'horizontal', $attr = '', $framework = 'bs3');
setOptions
$form->setOptions($user_options = array());
setMethod
$form->setMethod($method);
setAction
$form->setAction($url, $add_get_vars = true);
startFieldset
$form->startFieldset($legend = '');
endFieldset
$form->endFieldset();
startDependantFields
$form->startDependantFields($parent_field, $show_values);
endDependantFields
$form->endDependantFields();
clear static
Form::clear($form_ID);
registerValues static
Form::registerValues($form_ID);
mergeValues static
Form::mergeValues($form_names_array);
testToken static
Form::testToken($form_ID);

Elements

addInput
$form->addInput($type, $name, $value = '', $label = '', $attr = '');
groupInputs
$form->groupInputs($input1, $input2, $input3 = '', $input4 = '');
addTextarea
$form->addTextarea($name, $value = '', $label = '', $attr = '');
addOption
$form->addOption($select_name, $value, $txt, $group_name = '', $attr = '');
addSelect
$form->addSelect($select_name, $label = '', $attr = '', $displayGroupLabels = true);
addCountrySelect
$form->addCountrySelect($select_name, $label = '', $attr = '', $user_options = array());
addRadio
$form->addRadio($group_name, $label, $value, $attr = '');
printRadioGroup
$form->printRadioGroup($group_name, $label = '', $inline = true, $attr = '');
addCheckbox
$form->addCheckbox($group_name, $label, $value, $attr = '');
printCheckboxGroup
$form->printCheckboxGroup($group_name, $label = '', $inline = true, $attr = '');
addBtn
$form->addBtn($type, $name, $value, $text, $attr = '', $btnGroupName = '')
printBtnGroup
$form->printBtnGroup($btnGroupName, $label = '')
addHtml
$form->addHtml($html, $element_name = '', $pos = 'after');
addInputWrapper
$form->addInputWrapper($html, $element_name);

Rendering

render
$form->render([$debug = false, $display = true]);
printIncludes
$form->printIncludes($type, $debug = false);
printJsCode
$form->printJsCode($debug = false);

Shortcut functions

setCols
$form->setCols($labelsCols, $fieldsCols, $breakpoint = 'sm');
addHelper
$form->addHelper($helper_text, $element_name);
addIcon
$form->addIcon($input_name, $icon_html, $pos);

Plugins

addPlugin
$form->addPlugin($plugin_name, $selector, $js_content = 'default', $js_replacements = '');
addFileUpload
$form->addFileUpload($type, $name, $value = '', $label = '', $attr = '', $fileUpload_config = '');
addRecaptcha
$form->addRecaptcha($key);

Popover & Modal

popover
$form->popover('#popover-link', $popover_options);
modal
$form->modal('#modal-target');

Email sending

sendMail static
Form::sendMail($options, $smtp_settings = array());