2017 © Pedro Peláez
 

symfony-bundle file-bundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

image

kitpages/file-bundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  • Wednesday, November 22, 2017
  • by kitpages
  • Repository
  • 9 Watchers
  • 8 Stars
  • 26,500 Installations
  • JavaScript
  • 2 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 18 Versions
  • 3 % Grown

The README.md

KitpagesFileBundle

This is an ajax upload system for symfony., (*1)

author : Philippe Le Van (@plv), (*2)

Installation

hum... as usual..., (*3)

put the code in vendors/Kitpages/FileBundle, (*4)

add vendors/ in the app/autoload.php, (*5)

add the new Bundle in app/appKernel.php, (*6)

You need to create a table in the database : launch command: php app/console doctrine:schema:update, (*7)

Add a field file upload in a form

In form Class $builder->add( 'fileId', 'hidden', array( "label" => "File" ) );, (*8)

In file Twig , (*9)

{% include 'KitpagesFileBundle:Upload:pluginJs.html.twig' ignore missing %}, (*10)

<form class="standard-form" {{ form_enctype(form) }} method="POST">
    <div id="form">
        {{ form_row(
        form.title
        ) }}
        <div>
            <label>Image</label>
            {{ form_widget(form.file) }}
            {% render 'KitpagesFileBundle:Upload:widget' with {'fieldId': 'form_fileId', 'itemClass': 'AppSiteBundle:Document', 'itemId': form.vars.value.id, parameterList:{'multi': false, 'publishParent': false} } %}
        </div>
        {{ form_widget(form) }}
    </div>
    <input type="submit" value="Save"/>
</form>

Attention fieldId = the attribute ID of input generate by "{{ form_widget(form.fileId) }}" in the form, (*11)

UPDATE DATABASE IF EXISTS

updates an existing database in version1.2.0, (*12)

Installation ImagineBundle and kitpagesFileSystemBundle

Step1: add the following entries to the deps in the root of your project file:, (*13)

[Imagine] git=http://github.com/avalanche123/Imagine.git target=imagine, (*14)

[KitpagesFileSystemBundle] git=http://github.com/kitpages/KitpagesFileSystemBundle.git target=Kitpages/FileSystemBundle, (*15)

Step2: Configure the autoloader, (*16)

Add the following entries to your autoloader:, (*17)

<?php // app/autoload.php * autoload.php $loader->registerNamespaces(array( // ... 'Imagine' => DIR.'/../vendor/imagine/lib', ));, (*18)

Step3: AppKernel.php Add the following entries to your autoloader: $bundles = array( ... new Kitpages\FileSystemBundle\KitpagesFileSystemBundle(), );, (*19)

Step4:, (*20)

Configuration example

kitpages_file: tmp_dir: %kernel.root_dir%/data/tmp type_list: image: resize: form: 'kit_file.image.resize.form' form_twig: 'KitpagesFileBundle:ActionOnFile:Image/Resize/form.html.twig' handler_form: 'kit_file.image.resize.form.handler' library: 'imagine.gd', (*21)

kitpages_file_system: file_system_list: kitpagesFile: local: directory_public: %kernel.root_dir%/../web directory_private: %kernel.root_dir% base_url: %base_url%, (*22)

Step5: php bin/vendors update, (*23)

Step6: launch command: php app/console kitFile:updateDatabase, (*24)

Extend entity

see entity File create a entity - class Extendentity extends FileBase create a repository - class ExtendentityRepository extends FileBaseRepository { CONST entity = 'AppSiteBundle:Extendentity'; }, (*25)

complete config.yml entity_file_name_list: default : class: Kitpages\FileBundle\Entity\File data_dir_prefix: /default Extendentity : class: App\SiteBundle\Entity\Extendentity data_dir_prefix: /ExtendentityDir, (*26)

The Versions

08/10 2013

v3.0.2

3.0.2.0 https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

The Development Requires

by Sebastien Lefebvre

upload files resize encoding kitpages cms

09/09 2013

v3.0.1

3.0.1.0 https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

The Development Requires

by Sebastien Lefebvre

upload files resize encoding kitpages cms

09/09 2013

v3.0.0

3.0.0.0 https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

The Development Requires

by Sebastien Lefebvre

upload files resize encoding kitpages cms

12/10 2012

v2.1.0RC1

2.1.0.0-RC1 https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

The Development Requires

by Sebastien Lefebvre

upload files resize encoding kitpages cms

11/10 2012

v2.1.0BETA5

2.1.0.0-beta5 https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

The Development Requires

by Sebastien Lefebvre

upload files resize encoding kitpages cms

10/10 2012

v2.1.0BETA4

2.1.0.0-beta4 https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

The Development Requires

by Sebastien Lefebvre

upload files resize encoding kitpages cms

10/10 2012

v2.1.0BETA3

2.1.0.0-beta3 https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

The Development Requires

by Sebastien Lefebvre

upload files resize encoding kitpages cms

09/10 2012

v2.1.0BETA2

2.1.0.0-beta2 https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

The Development Requires

by Sebastien Lefebvre

upload files resize encoding kitpages cms

08/10 2012

v2.1.0BETA1

2.1.0.0-beta1 https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

The Development Requires

by Sebastien Lefebvre

upload files resize encoding kitpages cms

24/05 2012

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

by Sebastien Lefebvre

upload files resize encoding kitpages cms

24/05 2012

v2.0.0

2.0.0.0 https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

by Sebastien Lefebvre

upload files resize encoding kitpages cms

24/05 2012

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/kitpages/KitpagesFileBundle

FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle

  Sources   Download

BSD

The Requires

 

by Sebastien Lefebvre

upload files resize encoding kitpages cms