feat: link terms in confirmation checkbox label
This commit is contained in:
@@ -13,8 +13,18 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class BookingCreateStep4Type extends AbstractType
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $termsAndConditionsUrl,
|
||||
) {
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$termsLink = sprintf(
|
||||
'<a href="%s" target="_blank" rel="noopener" class="underline">AGB</a>',
|
||||
htmlspecialchars($this->termsAndConditionsUrl, ENT_QUOTES, 'UTF-8')
|
||||
);
|
||||
|
||||
$builder
|
||||
->add('confirmationAccepted', CheckboxType::class, [
|
||||
'label' => 'Ich bestätige, dass alle Angaben korrekt sind und möchte verbindlich buchen.',
|
||||
@@ -26,7 +36,8 @@ class BookingCreateStep4Type extends AbstractType
|
||||
],
|
||||
])
|
||||
->add('termsAccepted', CheckboxType::class, [
|
||||
'label' => 'Ich bestätige, dass ich die AGB akzeptiere',
|
||||
'label' => sprintf('Ich bestätige, dass ich die %s akzeptiere', $termsLink),
|
||||
'label_html' => true,
|
||||
'mapped' => false,
|
||||
'constraints' => [
|
||||
new Assert\IsTrue(
|
||||
|
||||
Reference in New Issue
Block a user