class CurrentImageSizeExtension extends Twig_Extension

Class CurrentImageSizeExtension is injected as alligator.current_image_size_extension service. CurrentImageSizeExtension handles the logic and provides necessary data for managed entity in twig.

Methods

__construct(ThumbnailSettingsManager $manager)

CurrentImageSizeExtension constructor.

string
getName()

Returns the name of the extension.

getFunctions()

{@inheritdoc}

string
getExtensionBySize(string $webPath, string $size)

Get extension by size for provided webPath and size

string
getDefaultExtension($webPath, $size = null)

Get default extension by webpath

array
getDefault()

Get default thumbnail size

setCurrentSizeFromDb()

Method that sets to cache current setting from db

setPossibleSizes()

Method that set possible sizes based on defined possible sizes in class PossibleThumbnailSizes

setPossibleSizeNames()

Method that set possible sizes based on defined possible sizes in class PossibleThumbnailSizes

Details

at line 47
__construct(ThumbnailSettingsManager $manager)

CurrentImageSizeExtension constructor.

Parameters

ThumbnailSettingsManager $manager

at line 57
string getName()

Returns the name of the extension.

Return Value

string The extension name

at line 65
getFunctions()

{@inheritdoc}

at line 81
string getExtensionBySize(string $webPath, string $size)

Get extension by size for provided webPath and size

Parameters

string $webPath
string $size

Return Value

string

at line 97
string getDefaultExtension($webPath, $size = null)

Get default extension by webpath

Parameters

$webPath
$size

Return Value

string

at line 111
array getDefault()

Get default thumbnail size

Return Value

array

at line 119
setCurrentSizeFromDb()

Method that sets to cache current setting from db

at line 129
setPossibleSizes()

Method that set possible sizes based on defined possible sizes in class PossibleThumbnailSizes

at line 137
setPossibleSizeNames()

Method that set possible sizes based on defined possible sizes in class PossibleThumbnailSizes