2017 © Pedro Peláez
 

bundle asset-bundle

Acilia Asset Bundle

image

aciliainternet/asset-bundle

Acilia Asset Bundle

  • Thursday, April 12, 2018
  • by aciliainternet
  • Repository
  • 4 Watchers
  • 0 Stars
  • 2,148 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 16 Versions
  • 14 % Grown

The README.md

AssetBundle

Acilia Asset Bundle for Symfony2 and symfony3, (*1)

AssetBundle

Symfony2 and Symfony3 Asset bundle developed by Acilia Internet, (*2)

This bundle allows to upload and crop images, and save the images as an "Asset" entity on a database., (*3)

Installation and configuration:

Pretty simple with Composer, run:, (*4)

composer require aciliainternet/asset-bundle

Add AssetBundle to your application kernel

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Acilia\Bundle\AssetBundle\AciliaAssetBundle(),
        // ...
    );
}

Add assets resources to your public dir

php bin/console assets:install web/backend/
{% stylesheets
    'bundles/aciliaasset/css/plugins/cropper/cropper.min.css'
    filter='cssrewrite' output='css/compiled/app.css' %}
    <link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}

% javascripts
    'bundles/aciliaasset/js/plugins/cropper/cropper.min.js'
    'bundles/aciliaasset/js/cropper.js'
    'bundles/aciliaasset/js/uploader.js'
    output='js/compiled/app.js' %}
    
{% endjavascripts %}

, (*5)

Configuration example

You must configure some parameters, (*6)

acilia_asset:
    assets_images: Resources/config/images.yml  # yaml file to indicate ratios and sizes
    assets_dir: /var/www/media/                 # path to where store the images uploaded
    assets_public: /media                       # relative path to the images on the web server (default /media)
    assets_domain: www.my-images.com            # domain from which the images can be access

Image sizes file example:, (*7)

ratios: { 177: 16x9, 100: 1x1, 200: 2x1, 133: 4x3 }

renditions:
    main_highlight: { large: 1200x675,  medium: 1024x576, small: 640x640 }
    big_cards: { large: 1200x675, medium: 1024x576, small: 640x360 }
    secondary_highlight: { large: 600x338, medium: 1024x576, small: 640x360 }

entities:
    card:
        image:
            title: Main
            renditions: [ main_highlight, secondary_highlight, big_cards ]
            attribute: image

    serie:
        main:
            title: Main image
            renditions: [ main_highlight, big_cards ]
            attribute: picture

The Versions

12/04 2018