2017 © Pedro PelĂĄez
 

symfony-bundle upload-bundle

Simple upload with symfony framework

image

jprud67/upload-bundle

Simple upload with symfony framework

  • Monday, July 16, 2018
  • by jprud67
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

UploadBundle

Simple upload with symfony framework, (*1)

Installation

``` bash composer require jprud67/upload-bundle, (*2)

# Ajouter au app\AppKernel.php ou  config\bundles.php
``` php
 // app/AppKernel.php

    // ...
    class AppKernel extends Kernel
    {
        public function registerBundles()
        {
            $bundles = array(
                // ...

                new Jprud67\UploadBundle\UploadBundle(),
            );

            // ...
        }

        // ...
    }
 ```
# Usage

Regardons un exemple en utilisant une Product entité ORM fictive :

``` php
<?php
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Jprud67\UploadBundle\Annotation\Uploadable;
use Jprud67\UploadBundle\Annotation\UploadableField;

/**
 * Product
 *
 * @ORM\Table(name="product")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\ProductRepository")
 * @Uploadable()
 */
class Product
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="filename", type="string", length=255,nullable=true)
     */
    private $filename;

    /**
     * @UploadableField(filename="filename",path="Uploads")
    */
    private $file;


    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return Product
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @return string
     */
    public function getFilename()
    {
        return $this->filename;
    }

    /**
     * @param string $filename
     */
    public function setFilename($filename)
    {
        $this->filename = $filename;
    }

    /**
     * @return mixed
     */
    public function getFile()
    {
        return $this->file;
    }

    /**
     * @param mixed $file
     */
    public function setFile($file)
    {
        $this->file = $file;
    }
}

The Versions

16/07 2018

dev-master

9999999-dev

Simple upload with symfony framework

  Sources   Download

MIT

The Requires

 

by Prudence Dieudonné ASSOGBA

16/07 2018

1.0.0

1.0.0.0

Simple upload with symfony framework

  Sources   Download

MIT

The Requires

 

by Prudence Dieudonné ASSOGBA