public function buildForm(FormBuilderInterface $builder, array $options) { $formUtil = parent::buildForm($builder, $options); $formUtil->addDescriptionElement(); $formUtil->addDateElement('boughtAt')->addDateElement('startedAt')->addDateElement('finishedAt')->addDateElement('returnedAt'); $builder->add('site', EntityType::class, array('class' => 'AppBundle:FinanceSite', 'choice_label' => 'title'))->add('amount', NumberType::class)->add('total', NumberType::class)->add('monthlyReturn', NumberType::class)->add('rate', NumberType::class)->add('type', ChoiceType::class, array('choices' => array_combine(Finance::getTypes(), Finance::getTypes()))); }
public function buildForm(FormBuilderInterface $builder, array $options) { $formUtil = parent::buildForm($builder, $options); $formUtil->addDescriptionElement()->addCategoryElement()->addDateElement('deadline'); $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { $deadline = $event->getData(); if (!$deadline || null === $deadline->getId()) { $form = $event->getForm(); $form->add('repeat', TextType::class, array('mapped' => false, 'required' => false)); } }); }
public function buildForm(FormBuilderInterface $builder, array $options) { $formUtil = parent::buildForm($builder, $options); $formUtil->addDescriptionElement()->addDateElement('doneAt'); $builder->add('task', EntityType::class, array('class' => 'AppBundle:Task', 'choice_label' => 'title', 'disabled' => true))->add('hours', NumberType::class); }
public function buildForm(FormBuilderInterface $builder, array $options) { $formUtil = parent::buildForm($builder, $options); $formUtil->addDescriptionElement()->addCategoryElement(); $builder->add('done', CheckboxType::class, array('required' => false)); }
public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); $builder->add('url', UrlType::class, array('required' => false)); }