40 lines
635 B
PHP
40 lines
635 B
PHP
|
<?php
|
||
|
|
||
|
|
||
|
namespace App\Form;
|
||
|
|
||
|
|
||
|
use App\Entity\Blog;
|
||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||
|
|
||
|
/**
|
||
|
* Class BlogFormType
|
||
|
* @package App\Form
|
||
|
*/
|
||
|
class BlogFormType extends \Symfony\Component\Form\AbstractType
|
||
|
{
|
||
|
/**
|
||
|
* {@inheritdoc}
|
||
|
*/
|
||
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||
|
{
|
||
|
$builder
|
||
|
->add('title')
|
||
|
->add('teaser')
|
||
|
->add('content')
|
||
|
->add('author');
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* {@inheritdoc}
|
||
|
*/
|
||
|
public function configureOptions(OptionsResolver $resolver)
|
||
|
{
|
||
|
$resolver->setDefaults([
|
||
|
'data_class' => Blog::class
|
||
|
]);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|