2017 © Pedro Peláez
 

symfony-bundle enhanced-file

Enhanced file type for Symfony forms

image

vria/enhanced-file

Enhanced file type for Symfony forms

  • Saturday, September 17, 2016
  • by riabchenkovlad
  • Repository
  • 2 Watchers
  • 1 Stars
  • 175 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 21 % Grown

The README.md

VRiaEnhancedFileBundle

Build Status, (*1)

File type for Symfony forms with additional functionality:, (*2)

  • if file has been previously uploaded, the download link is rendered
  • previously uploaded file can be deleted if new one is uploaded

Installation

Using Composer, run:, (*3)

composer require vria/enhanced-file

Add the VRiaNoDiacriticBundle to your application kernel:, (*4)

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new VRia\Bundle\EnhancedFileBundle\VRiaEnhancedFileBundle(),
    );
}

Use

In Symfony 3 you should use:, (*5)

$form = $this->createFormBuilder()
    ->add('file', EnhancedFileType::class, $options)
    ...

While in Symfony ~2.3:, (*6)

$form = $this->createFormBuilder()
    ->add('file', 'enhanced_file', $options)
    ...

$options is an array of options form FormType Field enlarged with:, (*7)

  • directory_path - physycal directory to put files. E.g. $this->get('kernel')->getRootDir() . '/../web/upload/'. Required
  • public_directory_path - path from your public directory (often /web) to directory with files. E.g. '/upload/'. Required
  • delete_previous_file - whether to delete previously uploaded file. Default value is true

So, the complete definition could be:, (*8)

$form = $this->createFormBuilder()
    ->add('file', EnhancedFileType::class, array(
        'label' => 'Curriculum vitae',
        'directory_path' => $this->get('kernel')->getRootDir() . '/../web/upload/',
        'public_directory_path' => '/upload/',
        'required' => false
    ))

The Versions

17/09 2016

dev-symfony23

dev-symfony23

Enhanced file type for Symfony forms

  Sources   Download

MIT

The Requires

 

file form symfony upload

17/09 2016

dev-master

9999999-dev

Enhanced file type for Symfony forms

  Sources   Download

MIT

The Requires

 

The Development Requires

file form symfony upload

09/05 2016

0.0.2

0.0.2.0

Enhanced file type for Symfony forms

  Sources   Download

MIT

The Requires

 

file form symfony upload

08/05 2016

1.0.2

1.0.2.0

Enhanced file type for Symfony forms

  Sources   Download

MIT

The Requires

 

The Development Requires

file form symfony upload

08/05 2016

0.0.1

0.0.1.0

Enhanced file type for Symfony forms

  Sources   Download

MIT

The Requires

 

The Development Requires

file form symfony upload

08/05 2016

1.0.1

1.0.1.0

Enhanced file type for Symfony forms

  Sources   Download

MIT

The Requires

 

The Development Requires

file form symfony upload

05/05 2016

1.0.0

1.0.0.0

Enhanced file type for Symfony forms

  Sources   Download

MIT

The Requires

 

The Development Requires

file form symfony upload

26/04 2016

0.0.0

0.0.0.0

Enhanced file type for Symfony forms

  Sources   Download

MIT

The Requires

 

The Development Requires

file form symfony upload