You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
<?php |
|
|
|
namespace KekRozsak\FrontBundle\Form\Type; |
|
|
|
use Symfony\Component\Form\AbstractType; |
|
use Symfony\Component\Form\FormBuilderInterface; |
|
use Symfony\Component\OptionsResolver\OptionsResolverInterface; |
|
|
|
class BookType extends AbstractType |
|
{ |
|
public function buildForm(FormBuilderInterface $builder, array $options) |
|
{ |
|
$builder |
|
->add( |
|
'author', |
|
null, |
|
array( |
|
'label' => 'Szerző', |
|
) |
|
) |
|
->add( |
|
'title', |
|
null, |
|
array( |
|
'label' => 'Cím', |
|
) |
|
) |
|
->add( |
|
'year', |
|
null, |
|
array( |
|
'label' => 'Kiadás éve', |
|
) |
|
) |
|
->add( |
|
'commentable', |
|
null, |
|
array( |
|
'label' => 'Kommentelhető?', |
|
'required' => false |
|
) |
|
) |
|
; |
|
} |
|
|
|
public function setDefaultOptions(OptionsResolverInterface $resolver) |
|
{ |
|
$resolver->setDefaults(array( |
|
'data_class' => 'KekRozsak\FrontBundle\Entity\Book' |
|
)); |
|
} |
|
|
|
public function getName() |
|
{ |
|
return 'kekrozsak_frontbundle_booktype'; |
|
} |
|
}
|
|
|