2017 © Pedro Peláez
 

symfony-bundle file-upload-bundle

File upload functionality for Symfony

image

connectholland/file-upload-bundle

File upload functionality for Symfony

  • Monday, February 6, 2017
  • by niels-nijens
  • Repository
  • 6 Watchers
  • 0 Stars
  • 958 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 4 Versions
  • 23 % Grown

The README.md

FileUploadBundle

File Upload integration for Symfony 2.4+ and 3+., (*1)

Installation using Composer

Run the following command to add the package to the composer.json of your project:, (*2)

``` bash $ composer require connectholland/file-upload-bundle, (*3)


### Enable the bundle Enable the bundle in the kernel: ``` php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new ConnectHolland\FileUploadBundle(), // ... ); }

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:, (*4)

``` yml, (*5)

app/config/config.yml

file_upload: path: "%kernel.root_dir%/../../some-directory-outside-of-the-project/%kernel.environment%", (*6)


#### 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: ``` php namespace AppBundle\Entity; use ConnectHolland\FileUploadBundle\Model\UploadObjectInterface; use ConnectHolland\FileUploadBundle\Model\UploadTrait; class Entity implements UploadObjectInterface { use UploadTrait { getFileUpload as getImageUpload; setFileUpload as setImageUpload; getFileUpload as getAnotherImageUpload; setFileUpload as setAnotherImageUpload; } }

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'., (*7)

Credits

License

This package is licensed under the MIT License. Please see the LICENSE file for details., (*8)

The Versions

06/02 2017

dev-master

9999999-dev

File upload functionality for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matthijs Hasenpflug

12/08 2016

v0.1.2

0.1.2.0

File upload functionality for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matthijs Hasenpflug

12/08 2016

0.1.1

0.1.1.0

File upload functionality for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matthijs Hasenpflug

12/08 2016

0.1.0

0.1.0.0

File upload functionality for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matthijs Hasenpflug