Contao Utils Bundle

ImageExtension extends AbstractExtension
in package
implements ContainerAwareInterface uses ContainerAwareTrait

Table of Contents

Interfaces

ContainerAwareInterface

Methods

getFilters()  : array<string|int, mixed>|array<string|int, Twig_SimpleFilter>
Get list of twig filters.
getImage()  : string
Get image based on given path/uuid.
getImageCaption()  : string|null
Get image caption based on given path/uuid.
getImageData()  : array<string|int, mixed>
Get image data based on given path/uuid.
getImageGallery()  : string
getImageSize()  : mixed
getImageWidth()  : string|null
Get image width based on given path/uuid.

Methods

getFilters()

Get list of twig filters.

public getFilters() : array<string|int, mixed>|array<string|int, Twig_SimpleFilter>
Return values
array<string|int, mixed>|array<string|int, Twig_SimpleFilter>

getImage()

Get image based on given path/uuid.

public getImage(mixed $image[, string|array<string|int, mixed> $size = null ][, array<string|int, mixed> $data = [] ][, string $template = 'image.html.twig' ]) : string
Parameters
$image : mixed

File path/uuid

$size : string|array<string|int, mixed> = null

Array or serialized string containing [width, height, imageSize-ID]

$data : array<string|int, mixed> = []

Add image data here [href => 'URL', class => 'img css class']…

$template : string = 'image.html.twig'

Use custom image template

Tags
throws
InvalidArgumentException
throws
Twig_Error_Loader
throws
Twig_Error_Runtime
throws
Twig_Error_Syntax
Return values
string

Image html element with given size

getImageCaption()

Get image caption based on given path/uuid.

public getImageCaption(mixed $image) : string|null
Parameters
$image : mixed

File path/uuid

Return values
string|null

Image caption if available, else null

getImageData()

Get image data based on given path/uuid.

public getImageData(mixed $image[, string|array<string|int, mixed> $size = null ][, array<string|int, mixed> $data = [] ]) : array<string|int, mixed>
Parameters
$image : mixed

File path/uuid

$size : string|array<string|int, mixed> = null

Array or serialized string containing [width, height, imageSize-ID]

$data : array<string|int, mixed> = []

Add image data here [href => 'URL', class => 'img css class']…

Return values
array<string|int, mixed>

Image data

getImageGallery()

public getImageGallery(mixed $images[, string $template = 'image_gallery.html.twig' ]) : string
Parameters
$images : mixed
$template : string = 'image_gallery.html.twig'
Return values
string

getImageSize()

public getImageSize(mixed $size) : mixed
Parameters
$size : mixed

getImageWidth()

Get image width based on given path/uuid.

public getImageWidth(mixed $image) : string|null
Parameters
$image : mixed

File path/uuid

Return values
string|null

Image caption if available, else null


        
On this page

Search results