Add an image field to an entity, using vichuploader
The process of adding file uploads to an entity is documented in the Symfony cookbook. As one quickly notices, the default technique requires you to hard-code a file path within the entity, and copy-paste some dull code. The VichUploader Bundle (get it at github) moves required paths to the config.yml file and abstracts some of that code away. But you'll still need to mess about when you add an image or other uploadable item to your entity.