我有一张表格:
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('file', 'file', array(
'required' => true,
'data_class' => 'MyBundle\Document\File\ImageFile'
))
.......
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'MyBundle\Document\User',
'csrf_protection' => false
));
}
问候,马雷克