From 363b7bc314ecf956d0c15ed802fb5deed42fd1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 8 Apr 2023 01:24:17 +0200 Subject: [PATCH] Do not show a unecessary label in front of the boolean constraint types checkboxes --- src/Form/Filters/Constraints/BooleanConstraintType.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Form/Filters/Constraints/BooleanConstraintType.php b/src/Form/Filters/Constraints/BooleanConstraintType.php index e04e88d3..ebc5ce09 100644 --- a/src/Form/Filters/Constraints/BooleanConstraintType.php +++ b/src/Form/Filters/Constraints/BooleanConstraintType.php @@ -24,6 +24,8 @@ use App\DataTables\Filters\Constraints\BooleanConstraint; use App\Form\Type\TriStateCheckboxType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormView; use Symfony\Component\OptionsResolver\OptionsResolver; class BooleanConstraintType extends AbstractType @@ -43,4 +45,10 @@ class BooleanConstraintType extends AbstractType 'required' => false, ]); } + + public function finishView(FormView $view, FormInterface $form, array $options) + { + //Remove the label from the compound form, as the checkbox already has a label + $view->vars['label'] = false; + } } \ No newline at end of file