src/Form/ScoreType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\FormBuilderInterface;
  5. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  6. use App\Util\ScoreUtil;
  7. /**
  8.  *
  9.  * @author wendell.zheng <wxzheng@ustc.edu.cn>
  10.  */
  11. class ScoreType extends AbstractType
  12. {
  13.     public function buildForm(FormBuilderInterface $builder, array $options)
  14.     {
  15.         $builder
  16.         ->add('rank'ChoiceType::class, [
  17.             'label' => '等级',
  18.             'choices' => ScoreUtil::getRankOptions(),
  19.             'expanded' => true
  20.         ])
  21.             ->add('score'null, [
  22.             'label' => '分数',
  23.             'required' => true
  24.         ])
  25.             ->add('suggestion'null, [
  26.             'label' => '评审意见',
  27.             'required' => true,
  28.             'attr' => [
  29.                 'rows' => 10
  30.             ]
  31.         ]);
  32.     }
  33. }