diff --git a/class.formr.php b/class.formr.php index 96f6534..1c8f07e 100644 --- a/class.formr.php +++ b/class.formr.php @@ -3,7 +3,7 @@ namespace Formr; /** - * Formr (1.5.1) + * Formr (1.5.2) * a php library for rapid form development * https://formr.github.io * requires php >= 8.1 and gd (for uploads) @@ -31,7 +31,7 @@ class Formr { - public $version = '1.5.1'; + public $version = '1.5.2'; # each of these public properties acts as a 'preference' for Formr # and can be defined after instantiation. see documentation for more info. @@ -707,6 +707,11 @@ protected function _fix_classes($element, $data) } } + # append any custom classes + if (!empty($data['class'])) { + $classes .= ' ' . $data['class']; + } + if (empty($class_string)) { if ($data['type'] == 'submit' || $data['type'] == 'button') { if ($this->_wrapper_is('bootstrap')) { diff --git a/lib/wrappers/bootstrap.php b/lib/wrappers/bootstrap.php index 9cd9194..b4ab580 100644 --- a/lib/wrappers/bootstrap.php +++ b/lib/wrappers/bootstrap.php @@ -74,13 +74,17 @@ public function bootstrap5($element = '', $data = ''): string $return .= $this->formr->_print_field_comment($data); # open the wrapping div - if ($this->formr->use_element_wrapper_div) { + if ($this->formr->use_element_wrapper_div && !isset($data['checkbox-inline'])) { $return .= "
".PHP_EOL; } # checkbox or radio if ($this->formr->type_is_checkbox($data)) { - $return .= "
".PHP_EOL; + if (isset($data['checkbox-inline'])) { + $return .= "
".PHP_EOL; + } else { + $return .= "
".PHP_EOL; + } $return .= $element.PHP_EOL; $return .= "
".PHP_EOL; } @@ -182,11 +186,11 @@ public function bootstrap4($element = '', $data = ''): string if ($this->formr->type_is_checkbox($data)) { # input is a checkbox or radio # don't print the