src/Form/AttachmentType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use Symfony\Component\Form\FormBuilderInterface;
  4. use Vich\UploaderBundle\Form\Type\VichFileType;
  5. /**
  6.  *
  7.  * @author wendell.zheng <wxzheng@ustc.edu.cn>
  8.  */
  9. class AttachmentType extends NameType
  10. {
  11.     public function buildForm(FormBuilderInterface $builder, array $options)
  12.     {
  13.         parent::buildForm($builder$options);
  14.         $builder->add('attachment'VichFileType::class, [
  15.             'label' => '文件',
  16.             'required' => true,
  17.             'allow_delete' => false
  18.         ]);
  19.     }
  20. }