<?php
namespace App\Form\Inc;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Validator\Constraints\IsTrue;
class AgreeTermsType extends AbstractType
{
private $router;
public function __construct(UrlGeneratorInterface $ro){
$this->router = $ro;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
/**->add('agreeTerms', CheckboxType::class, [
'mapped' => false,
'label' => ' He leído y acepto el <a target="_blank" href="' . $this->router->generate('pag_cms_aviso_legal') . '" rel="nofollow" title="Aviso legal">Aviso legal</a>, la
<a href="' . $this->router->generate('pag_cms_politica_de_privacidad') . '" target="_blank" rel="nofollow" title="Política de privacidad">Política de privacidad</a>
y la <a href="' . $this->router->generate('pag_cms_politica_de_cookies') . '" target="_blank" rel="nofollow" title="Política de cookiesl">Política de cookies</a> de Insertia.net',
'translation_domain' => false,
'label_attr' => [
'class' => 'checkbox-custom checkbox-inline'
],
'constraints' => [
new IsTrue([
'message' => 'You should agree to our terms.',
]),
],
])*/
->add('agreeTerms', CheckboxType::class, [
'mapped' => false,
'label' => 'security.register.form.agreeterms.label',
'label_html' => true,
'translation_domain' => 'security',
'label_attr' => [
'class' => 'checkbox-custom checkbox-inline'
],
'constraints' => [
new IsTrue([
'message' => 'You should agree to our terms.',
]),
],
])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
]);
}
}