2017 © Pedro Peláez
 

symfony-bundle filepickerio-bundle

Symfony WebmilFilepickerIoBundle

image

webmil/filepickerio-bundle

Symfony WebmilFilepickerIoBundle

  • Wednesday, September 11, 2013
  • by imsashko
  • Repository
  • 1 Watchers
  • 3 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Symfony 2 FilepickerIo Bundle

Installation

Step 1) Download bundle

Method a) Using composer (symfony 2.1 pattern)

Add on composer.json (see http://getcomposer.org/), (*1)

"require" :  {
    // ...
    "webmil/filepickerio-bundle": "dev-master",
}

Method b) Using the deps file (symfony 2.0 pattern)

Add the following lines to your deps file and then run php bin/vendors install:, (*2)

[WebmilFilepickerIoBundle]
    git=https://github.com/imsashko/WebmilFilepickerIoBundle.git
    target=bundles/Webmil/FilepickerIoBundle
    version=origin/2.0

Step 2) Register the namespaces

If you installed the bundle by composer, use the created autoload.php (jump to step 3). Add the following namespace entry to the registerNamespaces call in your autoloader:, (*3)

<?php
// app/autoload.php
$loader->registerNamespaces(array(
    // ...
    'Webmil\\FilepickerIoBundle' => __DIR__.'/../vendor/bundles',
    // ...
));

Step 3) Register the bundle

To start using the bundle, register it in your Kernel:, (*4)

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Webmil\FilepickerIoBundle\WebmilFilepickerIoBundle(),
    );
    // ...
}

Step 4) Configure the bundle

# app/config/config.yml
webmil_filepicker_io:
    api_key: yourKey

Usage

Initializing in twig template:

{{ filepicker_io_initialize() }}

Adding an upload field to your form:

Set type to 'filepicker' in form builder. To enable drag&drop set 'dragdrop' => true. See the filepicker.io documentation for the full options list., (*5)

$form = $this->createFormBuilder()
    ->add('filepicker', 'filepicker', array(
        'dragdrop' => true,
        'attr' => array(
            'data-fp-mimetype' => 'image/png'
            )
        ))
    ->getForm();

Displaying an image:

{{ filepicker_io_image_tag('https://www.filepicker.io/api/file/hFHUCB3iTxyMzseuWOgG', {'w': '200'}, {'class': 'classname'}) }}

See the filepicker.io documentation for the full options list., (*6)

Allowing the user to download a file (or upload it to any of the supported services)

{{ filepicker_io_save_button('http://path/to/file.png', 'Download file', 'image/png', {'data-fp-suggestedFilename': 'name.png'}) }}

See the filepicker.io documentation for the full options list., (*7)

The Versions

11/09 2013

2.1.x-dev

2.1.9999999.9999999-dev

Symfony WebmilFilepickerIoBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Lavasov

file management

11/09 2013

dev-master

9999999-dev

Symfony WebmilFilepickerIoBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Lavasov

file management

27/02 2013

2.0.x-dev

2.0.9999999.9999999-dev

Symfony WebmilFilepickerIoBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Lavasov

file management