<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
/**
*
* @author wendell.zheng <wxzheng@ustc.edu.cn>
*/
class NoticeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('batch', null, [
'label' => '批次',
'disabled' => true
])->add('name', TextType::class, [
'label' => '标题',
'required' => true
])
->add('publishedAt', null, [
'label' => '发布日期',
'widget' => 'single_text',
'data' => new \DateTime()
])
->add('content', null, [
'label' => '内容'
]);
}
}