src/Form/BatchType.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use Symfony\Component\Form\FormBuilderInterface;
  4. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  5. use App\Entity\Batch;
  6. /**
  7.  *
  8.  * @author wendell.zheng <wxzheng@ustc.edu.cn>
  9.  */
  10. class BatchType extends NameType
  11. {
  12.     public function buildForm(FormBuilderInterface $builder, array $options)
  13.     {
  14.         parent::buildForm($builder$options);
  15.         $builder->add('open'null, [
  16.             'label' => '开放日期',
  17.             'widget' => 'single_text'
  18.         ])
  19.         ->add('type'ChoiceType::class, [
  20.             'label' => '类别',
  21.             'choices' => array_combine(Batch::TYPESBatch::TYPES),
  22.             'required' => true
  23.         ])
  24.             ->add('applyDeadline'null, [
  25.             'widget' => 'single_text',
  26.             'label' => '教师申请截止日期'
  27.         ])
  28.             ->add('collegeDeadline'null, [
  29.             'widget' => 'single_text',
  30.             'label' => '学院推荐截止日期'
  31.         ]);
  32.     }
  33. }