<?php
namespace App\Form\Type;
use App\Entity\Exercise;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class DificultyType extends AbstractType
{
public function configureOptions(OptionsResolver $resolver)
{
$choices = [
"label.".Exercise::DIFICULTY_TYPE_HIGH => Exercise::DIFICULTY_TYPE_HIGH,
"label.".Exercise::DIFICULTY_TYPE_MEDIUM => Exercise::DIFICULTY_TYPE_MEDIUM,
"label.".Exercise::DIFICULTY_TYPE_LOW => Exercise::DIFICULTY_TYPE_LOW,
];
$resolver->setDefaults([
'choices' => $choices,
]);
}
public function getParent()
{
return ChoiceType::class;
}
}