Download the PHP package connectholland/file-upload-bundle without Composer
On this page you can find all versions of the php package connectholland/file-upload-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download connectholland/file-upload-bundle
More information about connectholland/file-upload-bundle
Files in connectholland/file-upload-bundle
Package file-upload-bundle
Short Description File upload functionality for Symfony
License MIT
Informations about the package file-upload-bundle
FileUploadBundle
File Upload integration for Symfony 2.4+ and 3+.
Installation using Composer
Run the following command to add the package to the composer.json of your project:
Enable the bundle
Enable the bundle in the kernel:
Usage
1. Configure the FileUploadBundle for file uploads
The bundle requires a location to store the file uploads.
Configure the location with the existing FileUploadBundle configuration in your config.yml
file:
2. Modify your Doctrine entity class
To activate file uploads for a Doctrine entity you need to implement the UploadObjectInterface
and add getters and setters for the form fields.
For ease of use the FileUploadBundle provides an UploadTrait
to implement both the interface and the getters and setters:
In the above example you see the UploadTrait
with getters and setters for two file upload fields implemented.
Here the getImageUpload
method maps to a field called 'image' and getAnotherImageUpload
maps to 'another_image'.
Credits
- Niels Nijens
- All Contributors
License
This package is licensed under the MIT License. Please see the LICENSE file for details.
All versions of file-upload-bundle with dependencies
doctrine/orm Version ^2.5
symfony/framework-bundle Version ^2.4 | ^3.0