This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Ajout du champs dans le formulaire, un ChoiceType, multiple, expanded et required | |
* Image du rendu du champs : https://pasteboard.co/GEGqWpi.png | |
**/ | |
$constraints = array( | |
new NotBlank(array('message' => 'mandatory_field')) | |
); | |
$form->add( | |
'fieldValues', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* On affiche une coche pour chaque coregistration | |
*/ | |
$builder->addEventListener( | |
FormEvents::PRE_SET_DATA, | |
function (FormEvent $event) { | |
/** @var CoregistrationVO $coregistration */ | |
$coregistration = $event->getData(); | |
$form = $event->getForm(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace LB\LBBundle\Form\FormBuilder\Coregistration; | |
use LB\Common\VO\Coregistration\CoregistrationVO; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\Form\FormEvent; | |
use Symfony\Component\Form\FormEvents; |