Minirock
Minirock

Reputation: 666

FileType picker button

This is really basic...but I don't find where the documentation allow the modification

I've a form with a FileType.

It looks like this:

Label ------File Space-------- Browse Button

I've been able to change the label text. But I can't find how to specify the Browse button texte.

    $form = $this->createFormBuilder()
        ->add('importer', FileType::class, ['label' => 'Import CSV'])
        ->add('import', SubmitType::class, ['label' => 'Import'])
        ->getForm();

When I look into the FileType options I can't find what I'm looking for.

Thanks.

Upvotes: 0

Views: 91

Answers (1)

Ugo T.
Ugo T.

Reputation: 1078

I think you can try to use the attr option like this :

$form = $this->createFormBuilder()
        ->add('importer', FileType::class, [
              'label' => 'Import CSV',
              'attr' => ['placeholder' => 'Custom button name'],
         ])
        ->add('import', SubmitType::class, ['label' => 'Import'])
        ->getForm();

Upvotes: 1

Related Questions