Skip to content
Stanislav Opletal edited this page Jun 20, 2018 · 2 revisions

Setup

config.neon

uploader:
    storage: doctrine
    wwwDir: %wwwDir%
    request: @http.request
    linkGenerator: @application.linkGenerator

Docs


Install

    composer require relisoft/uploader

Format settings

    time: "H-i"
    date: "d-m-Y"
    types:
        deal: App\Model\Deal
        category: App\Model\Category
        composite_product: App\Model\CompositeProduct
        product: App\Model\Product
        service: App\Model\Service

You can set format for time and date which you have to set in PHP format code

format.neon

Size settings

    thumb:
        width: 256
        height: 256
        format: THUMBNAIL
    biggerThumb:
        width: 512
        height: 512
        format: THUMBNAIL

Each option mentioned here will be created when you upload images

format.neon

Save settings

thumb:
    folder: %wwwFolder%_%images%_%fileType%_%thumb%
    name: %actualDate%_%actualTime%_%hashName%_%ext%
    size: thumb
biggerThumb:
    folder: %wwwFolder%_%images%_%fileType%_%biggerthumb%
    name: %actualDate%_%actualTime%_%hashName%_%ext%
    size: biggerThumb
full:
    folder: %wwwFolder%_%images%_%fileType%
    name: %actualDate%_%actualTime%_%hashName%_%ext%
    size: null
Variables
%wwwFolder%: www folder
%fileType%: file type to string
%actualDate%: actual date
%actualTime%: actual time
%hashName%: hash of file name (md5)
%ext%: ext (png,jpg etc)
_: use as glue

Example:

name: %actualDate%_%actualTime%_%hashName%_%ext%

Result:

2018-07-01-22-00-smkdsanpokKSndsjkjds.png

Example:

folder: %wwwDir%_%images%_%fileType%_%thumb%

Result:

/www/images/workers/thumb

Here you set the file type of file saving, and more precisely where to save and also its dimensions - if the null dimension will not be formatted. You can use the available values ​​to edit the name. save.neon

Single uploader


Multi uploader


{control dropzone}
{block css} 
{include parent} 
{control dropzone:css} 
{/block} 
{block js} 
{include parent}
{control dropzone:js} 
{/block}

Clone this wiki locally