PHP Trait FluidTYPO3\Vhs\Traits\SourceSetViewHelperTrait

Datei anzeigen Open project: fluidtypo3/vhs

Public Methods

Method Description
addSourceSet ( TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder $tag, string $src ) : array used to attach srcset variants of a given image to the specified tag
getImgResource ( string $src, integer $width, string $format, string $quality, string $treatIdAsReference, array $params = null ) : string generates a copy of a give image with a specific width
getSourceSetWidths ( ) : array returns an array of srcsets based on the mixed ViewHelper input (list, csv, array, iterator)

Method Details

addSourceSet() public method

used to attach srcset variants of a given image to the specified tag
public addSourceSet ( TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder $tag, string $src ) : array
$tag TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder the tag to add the srcset as argument
$src string image path to render srcsets for
return array

getImgResource() public method

generates a copy of a give image with a specific width
public getImgResource ( string $src, integer $width, string $format, string $quality, string $treatIdAsReference, array $params = null ) : string
$src string path of the image to convert
$width integer width to convert the image to
$format string format of the resulting copy
$quality string quality of the resulting copy
$treatIdAsReference string given src argument is a sys_file_reference record
$params array additional params for the image rendering
return string

getSourceSetWidths() public method

returns an array of srcsets based on the mixed ViewHelper input (list, csv, array, iterator)
public getSourceSetWidths ( ) : array
return array