Download the PHP package kitpages/file-bundle without Composer
On this page you can find all versions of the php package kitpages/file-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kitpages/file-bundle
More information about kitpages/file-bundle
Files in kitpages/file-bundle
Package file-bundle
Short Description FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle
License MIT
Homepage https://github.com/kitpages/KitpagesFileBundle
Informations about the package file-bundle
KitpagesFileBundle
This is an ajax upload system for symfony.
author : Philippe Le Van (@plv)
Installation
hum... as usual...
put the code in vendors/Kitpages/FileBundle
add vendors/ in the app/autoload.php
add the new Bundle in app/appKernel.php
You need to create a table in the database : launch command: php app/console doctrine:schema:update
Add a field file upload in a form
In form Class $builder->add( 'fileId', 'hidden', array( "label" => "File" ) );
In file Twig <link rel="stylesheet" type="text/css" href="{{ asset ("bundles/kitpagesfile/uploadify/uploadify.css") }}" /> <link rel="stylesheet" type="text/css" href="{{ asset ("bundles/kitpagesfile/css/style.css") }}" />
<script type="text/javascript" src="{{ asset ("bundles/kitpagesfile/uploadify/jquery.uploadify.min.js") }}"> {% include 'KitpagesFileBundle:Upload:pluginJs.html.twig' ignore missing %}
<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
UPDATE DATABASE IF EXISTS
updates an existing database in version1.2.0
Installation ImagineBundle and kitpagesFileSystemBundle
Step1: add the following entries to the deps in the root of your project file:
[Imagine] git=http://github.com/avalanche123/Imagine.git target=imagine
[KitpagesFileSystemBundle] git=http://github.com/kitpages/KitpagesFileSystemBundle.git target=Kitpages/FileSystemBundle
Step2: Configure the autoloader
Add the following entries to your autoloader:
<?php // app/autoload.php
- autoload.php $loader->registerNamespaces(array( // ... 'Imagine' => DIR.'/../vendor/imagine/lib', ));
Step3: AppKernel.php Add the following entries to your autoloader: $bundles = array( ... new Kitpages\FileSystemBundle\KitpagesFileSystemBundle(), );
Step4: 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'
kitpages_file_system: file_system_list: kitpagesFile: local: directory_public: %kernel.root_dir%/../web directory_private: %kernel.root_dir% base_url: %base_url%
Step5: php bin/vendors update
Step6: launch command: php app/console kitFile:updateDatabase
Extend entity
see entity File create a entity
- class Extendentity extends FileBase
create a repository
- class ExtendentityRepository extends FileBaseRepository { CONST entity = 'AppSiteBundle:Extendentity'; }
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
All versions of file-bundle with dependencies
symfony/framework-bundle Version ~2.1
kitpages/file-system-bundle Version ~3.1
kitpages/util-bundle Version ~3.0
doctrine/orm Version ~2.2
imagine/imagine Version ~0.4.1
doctrine/doctrine-bundle Version ~1.1
symfony/monolog-bundle Version ~2.1