mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 19:43:49 +00:00
WIP Activity Model
This commit is contained in:
33
src/Bundle/ChillActivityBundle/Form/ActivityPresenceType.php
Normal file
33
src/Bundle/ChillActivityBundle/Form/ActivityPresenceType.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\ActivityBundle\Form;
|
||||
|
||||
use Chill\ActivityBundle\Entity\ActivityPresence;
|
||||
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 ActivityPresenceType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', TranslatableStringFormType::class)
|
||||
->add('active', ChoiceType::class, array(
|
||||
'choices' => array(
|
||||
'Yes' => true,
|
||||
'No' => false
|
||||
),
|
||||
'expanded' => true
|
||||
));
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => ActivityPresence::class
|
||||
));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user