form improvement

using theme clone
This commit is contained in:
Kevin Papst
2016-11-13 22:19:18 +01:00
parent cc269d3142
commit aaa2fffa08
22 changed files with 411 additions and 60 deletions

View File

@@ -14,6 +14,7 @@ namespace TimesheetBundle\Form;
use AppBundle\Form\Type\YesNoType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use TimesheetBundle\Entity\Activity;
@@ -34,20 +35,22 @@ class ActivityEditForm extends AbstractType
{
$builder
// string - length 255
->add('name', null, [
->add('name', TextType::class, [
'label' => 'label.name',
])
// text
->add('comment', TextareaType::class, [
'label' => 'label.comment',
'required' => false,
])
// entity type: project
->add('project', ProjectType::class, [
'label' => 'label.project',
])
// boolean
->add('visible', YesNoType::class, [
'label' => 'label.visible',
])
->add('project', ProjectType::class, [
'label' => 'label.project',
])
;
}