composer require everlutionsk/file-jet-bundle// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Everlution\FileJetBundle\EverlutionFileJetBundle()
);
}Following configuration snippet describes how to configure the bundle.
# app/config/config.yml
everlution_file_jet:
storages:
- id: <STORAGE_ID>
api_key: <API_KEY>
name: <CUSTOM_LOCAL_NAME>See example directory.
Use
{{ file_url(file, '<MUTATION>') }} in view, where file is an implementation of Everlution\FileJetBundle\Entity\File and second argument is the file mutation.
Resize: sz_1000x1000_100_100 => size = 1000x1000, offset = 100x100
Crop: c_1000x1000+100+100
Relative crop: c_0.4x0.89_0.1_0.1 => same as crop, but size and offset is in %.
Mutations can be chained like "sz_1000x1000,c_100x100".