Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Form\UZForms\Forms;
- use App\Form\DataTransformer\ApiIdArrayTransformer;
- use App\Form\UZForms\DataProviders\General\AdjuntosFormProvider;
- use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
- use Symfony\Component\Form\FormBuilderInterface;
- class AdjuntosChoiceType extends ChoiceType
- {
- /**
- * @var AdjuntosFormProvider
- */
- private $adjuntosFormProvider;
- public function __construct(AdjuntosFormProvider $adjuntosFormProvider)
- {
- parent::__construct(null);
- $this->adjuntosFormProvider = $adjuntosFormProvider;
- }
- public function buildForm(FormBuilderInterface $builder, array $options) {
- $options['choices'] = $this->adjuntosFormProvider->getAdjuntos();
- $options['attr']['class'] = 'form-control select2-multiple';
- // $builder->addModelTransformer(new ApiIdArrayTransformer('adjuntos'));
- parent::buildForm($builder, $options);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement