Functions reference

General

__construct
$form = new Form($form_ID, $layout = 'horizontal', $attr = '', $framework = 'bs4');
setMode
$form->setMode($mode);
setOptions
$form->setOptions($user_options = array());
setMethod
$form->setMethod($method);
setAction
$form->setAction($url, $add_get_vars = true);
startFieldset
$form->startFieldset($legend = '', $fieldset_attr = '', $legend_attr = '');
endFieldset
$form->endFieldset();
startDependentFields
$form->startDependentFields($parent_field, $show_values[, $inverse = false]);
endDependentFields
$form->endDependentFields();
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]);
useLoadJs
$form->useLoadJs($bundle = '');
printIncludes
$form->printIncludes($type, $debug = false, $display = true);
printJsCode
$form->printJsCode($debug = false);

Shortcut functions

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

Plugins

addPlugin
$form->addPlugin($plugin_name, $selector, $js_content = 'default', $js_replacements = '');
addFileUpload
$form->addFileUpload($type, $name, $value = '', $label = '', $attr = '', $fileUpload_config = '', $current_file = '');
addRecaptcha
$form->addRecaptcha($key);
addInvisibleRecaptcha
$form->addInvisibleRecaptcha($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());