dontHaveName
dontHaveName

Reputation: 1937

symfony form type file not working

I have a wierd problem. I can't add file type into form like so:

$builder->add('file', 'file', array('mapped' => 'false'));

It's throwing an error:

Could not load type "file"
500 Internal Server Error - InvalidArgumentException

Any thoughts what's causing that?

Upvotes: 1

Views: 374

Answers (1)

DavidODW
DavidODW

Reputation: 417

If you generate your form based on the entity class, please make sure that 'file' is exist as

protected $file;

in your entity class.

Upvotes: 1

Related Questions