mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Chill\ActivityBundle\Form;
|
|
|
|
use Symfony\Component\Form\AbstractType;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
|
|
|
class ActivityTypeType extends AbstractType
|
|
{
|
|
/**
|
|
* @param FormBuilderInterface $builder
|
|
* @param array $options
|
|
*/
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
{
|
|
$builder
|
|
->add('name', TranslatableStringFormType::class)
|
|
->add('active', ChoiceType::class, array(
|
|
'choices' => array(
|
|
'Yes' => true,
|
|
'No' => false
|
|
),
|
|
'expanded' => true
|
|
));
|
|
}
|
|
|
|
/**
|
|
* @param OptionsResolverInterface $resolver
|
|
*/
|
|
public function configureOptions(OptionsResolver $resolver)
|
|
{
|
|
$resolver->setDefaults(array(
|
|
'data_class' => 'Chill\ActivityBundle\Entity\ActivityType'
|
|
));
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getBlockPrefix()
|
|
{
|
|
return 'chill_activitybundle_activitytype';
|
|
}
|
|
}
|