-
-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
Hello,
currently it is only possible with great effort to use the forms in combination with Bootstrap 4+. It would be good if you could use the InputErrorClass independently from the helper formRow.
Or is there a better way to implement the attached example? See the following code snippets...
/** @var Laminas\Form\View\Helper\FormElementErrors $helper */
$helper = $this->formElementErrors();
$helper->setMessageOpenFormat('<small class="invalid-feedback">');
$helper->setMessageCloseString('</small>');
$helper->setMessageSeparatorString('');
<div class="form-group row">
<?php echo $this->formLabel($matriculationnumber); ?>
<div class="col-sm-10">
<?php if ($matriculationnumber->getMessages()) {
$classAttributes = $matriculationnumber->hasAttribute('class') ? $matriculationnumber->getAttribute('class') . ' ' : '';
$classAttributes = $classAttributes . 'is-invalid';
$matriculationnumber->setAttribute('class', $classAttributes);
} ?>
<?php echo $this->formElement($matriculationnumber); ?>
<?php echo $this->formElementErrors()->render($matriculationnumber); ?>
</div>
</div>
schwanma