2017 © Pedro Peláez
 

symfony-bundle uploadable

Bundle for easy integrations upload properties to entity

image

youshido/uploadable

Bundle for easy integrations upload properties to entity

  • Saturday, September 10, 2016
  • by portey
  • Repository
  • 3 Watchers
  • 0 Stars
  • 692 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 27 % Grown

The README.md

UploadableBundle

Bundle brings uploadable behavor for Symfony2/3 Doctrine Entities, (*1)

Install via Composer:

composer require youshido/uploadable, (*2)

Enable in your AppKernel.php:

new Youshido\UploadableBundle\UploadableBundle(),, (*3)

Add annotation to your entity:

``` php use Youshido\UploadableBundle\Annotations as Youshido;, (*4)

class Post {, (*5)

/**
 * @var string
 *
 * @ORM\Column(name="path", type="string", length=255)
 *
 * @Youshido\Uploadable(override="true", asserts={@Assert\File(
 *     maxSize = "1024k",
 *     mimeTypes = {"image/jpeg"},
 *     mimeTypesMessage = "Please upload a valid Image"
 * )})
 */
private $path;

### Use in controller: ``` php $post = new Post(); $form = $this->createFormBuilder($post, ['action' => $this->generateUrl('example1')]) ->add('path', 'Youshido\UploadableBundle\Type\UploadableFileType', ['entity_class' => 'AppBundle\Entity\Post']) ->add('submit', 'submit') ->getForm(); $form->handleRequest($request); if($form->isValid()){ $this->getDoctrine()->getManager()->persist($post); $this->getDoctrine()->getManager()->flush(); }

php if($request->getMethod() == 'POST'){ if($file = $request->files->get('path')){ if($post = $this->getDoctrine()->getRepository('AppBundle:Post')->find($id)){ $this->get('youshido.uploadable.enity_manager') ->saveFile($post, 'path', $file, true); } } }, (*6)

The Versions

10/09 2016

dev-master

9999999-dev https://github.com/Youshido/UploadableBundle

Bundle for easy integrations upload properties to entity

  Sources   Download

MIT

The Requires

 

by Alexandr Viniychuk
by Portey Vasil

file form bundle symfony upload file uploads

10/09 2016

v1.1.2

1.1.2.0 https://github.com/Youshido/UploadableBundle

Bundle for easy integrations upload properties to entity

  Sources   Download

MIT

The Requires

 

by Alexandr Viniychuk
by Portey Vasil

file form bundle symfony upload file uploads

11/04 2016

v1.1.1

1.1.1.0 https://github.com/Youshido/UploadableBundle

Bundle for easy integrations upload properties to entity

  Sources   Download

MIT

The Requires

 

by Alexandr Viniychuk
by Portey Vasil

file form bundle symfony upload file uploads

23/02 2016

v1.1.0

1.1.0.0 https://github.com/Youshido/UploadableBundle

Bundle for easy integrations upload properties to entity

  Sources   Download

MIT

The Requires

 

by Alexandr Viniychuk
by Portey Vasil

file form bundle symfony upload file uploads

02/07 2015

1.0.1

1.0.1.0 https://github.com/Youshido/UploadableBundle

Bundle for easy integrations upload properties to entity

  Sources   Download

MIT

The Requires

 

by Alexandr Viniychuk
by Portey Vasil

file form bundle symfony upload file uploads

02/07 2015

dev-develop

dev-develop https://github.com/Youshido/UploadableBundle

Bundle for easy integrations upload properties to entity

  Sources   Download

MIT

The Requires

 

by Alexandr Viniychuk
by Portey Vasil

file form bundle symfony upload file uploads

02/07 2015

1.0.0

1.0.0.0 https://github.com/Youshido/UploadableBundle

Bundle for easy integrations upload properties to entity

  Sources   Download

MIT

The Requires

 

by Alexandr Viniychuk
by Portey Vasil

file form bundle symfony upload file uploads