2017 © Pedro Peláez
 

symfony-bundle gaufrette-extras-bundle

Integrates the gaufrette-extras library into Symfony

image

kphoen/gaufrette-extras-bundle

Integrates the gaufrette-extras library into Symfony

  • Sunday, May 29, 2016
  • by K-Phoen
  • Repository
  • 1 Watchers
  • 3 Stars
  • 4,161 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

GaufretteExtrasBundle

GaufretteExrasBundle is a Symfony2 bundle integrating the Gaufrette Extras library., (*1)

Status

This project is DEPRECATED and should NOT be used., (*2)

If someone magically appears and wants to maintain this project, I'll gladly give access to this repository., (*3)

Installation

The recommended way to install this library is through composer., (*4)

Just create a composer.json file for your project:, (*5)

{
    "require": {
        "kphoen/gaufrette-extras-bundle": "~1.0"
    }
}

And run these two commands to install it:, (*6)

$ wget http://getcomposer.org/composer.phar
$ php composer.phar install

Register the KPhoenGaufretteExtrasBundle:, (*7)

# app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new KPhoen\GaufretteExtrasBundle\KPhoenGaufretteExtrasBundle(),
    );
}

Features

URL resolvers

Resolvers provide a quick and easy way to resolve filesystem entries to a URL. See GaufretteExtras., (*8)

A Twig extension is also provided, allowing the following things in templates:, (*9)

    <img src="{{ article.thumb|resolve("thumbs") }}" />

Here is the associated configuration:, (*10)

# gaufrette bundle
knp_gaufrette:
    adapters:
        thumbs_adapter:
            local:
                directory:  %kernel.root_dir%/../web/thumbs
                create:     true

    filesystems:
        thumbs:
            adapter:        thumbs_adapter

# gaufrette extras
k_phoen_gaufrette_extras:
    resolvers:
        thumbs:                 # the filesystem name
            prefix:             # the resolver to use
                path: /thumbs   # and its configuration

Image form type

ImageType to show the previously uploaded image., (*11)

Utilisation sample:, (*12)

<?php

class MyFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('avatar', 'image', array(
            'gaufrette'             => 'avatars',
            'image_path'            => 'avatar', // because there is a getAvatar() method in the data class

            'image_alt'             => 'Avatar',
            'image_width'           => '100px',
            'image_height'          => '100px',
            'no_image_placeholder'  => 'noImage.jpg',
        ));
    }
}

License

This bundle is released under the MIT License. See the bundled LICENSE file for details., (*13)

The Versions

29/05 2016

dev-master

9999999-dev

Integrates the gaufrette-extras library into Symfony

  Sources   Download

MIT

The Requires

 

gaufrette extras

20/04 2014

1.0.0

1.0.0.0

Integrates the gaufrette-extras library into Symfony

  Sources   Download

MIT

The Requires

 

gaufrette extras