mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 21:34:59 +00:00
add an "active" field on activity type
This commit is contained in:
@@ -4,7 +4,8 @@ namespace Chill\ActivityBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
||||
class ActivityTypeType extends AbstractType
|
||||
{
|
||||
@@ -16,13 +17,20 @@ class ActivityTypeType extends AbstractType
|
||||
{
|
||||
$builder
|
||||
->add('name', 'translatable_string')
|
||||
;
|
||||
->add('active', ChoiceType::class, array(
|
||||
'choices' => array(
|
||||
'Yes' => true,
|
||||
'No' => false
|
||||
),
|
||||
'choices_as_values' => true,
|
||||
'expanded' => true
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OptionsResolverInterface $resolver
|
||||
*/
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Chill\ActivityBundle\Entity\ActivityType'
|
||||
|
Reference in New Issue
Block a user