Hi,
I don't know if is it, but I think the form of method call to create
the form is deprecated.
The current way to do it is :
$form = $this->get('form.factory')->create(new FormType());
if ($this->get('request')->getMethod() == 'POST') {
$form->bindRequest($this->get('request'));
}
Little things have changed and these changes should be the reason.
Cheers.
--
Eric Malzone
dbenjamin escreveu:
> Hi,
>
> I'm trying to handle multiple file uploads with a binded array.
>
> // FilesType
> $builder
> ->add('photo1', 'file', array(type' => 'file'))
> ->add('photo2', 'file', array('type' => 'file'))
> ->add('photo3', 'file', array('type' => 'file'))
> ;
>
> // controller
> $files = array(
> 'photo1' => null,
> 'photo2' => null,
> 'photo3' => null,
> );
>
> $form = $this->createForm(new FilesType(), $files);
> if ('POST' == $request->getMethod()) {
> $form->bindRequest($request); // Throws an error
> }
>
> This actually throws an error from DataTransformer : "The key "file" should
> be empty or instance of File"
>
> That should work, no ? I'm not sure what i'm doing wrong.
>
> Any idea ?
>
>
> Thanks,
> Benjamin.
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en