gergelypolonkai-web-symfony2/src/GergelyPolonkai/FrontBundle/Form/PostType.php

34 lines
1.0 KiB
PHP

<?php
namespace GergelyPolonkai\FrontBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class PostType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('title')
->add('draft', null, array('required' => false))
->add('updateDate', 'checkbox', array('property_path' => false, 'required' => false, 'label' => 'Update creation date'))
->add('content', 'ckeditor')
->add('tags', 'text', array('property_path' => false, 'required' => false, 'label' => 'Tags'))
;
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'GergelyPolonkai\FrontBundle\Entity\Post'
));
}
public function getName()
{
return 'gergelypolonkai_frontbundle_posttype';
}
}