Ratio

Table of Contents

Properties

$id  : string
$title  : string
$value  : float

Methods

__construct()  : mixed
asArray()  : array{id: string, title: string, value: float}
createMultipleFromConfiguration()  : array<int, Ratio>
getId()  : string
getRatioValue()  : float
isFree()  : bool
prepareAspectRatioId()  : string
Adjust names of Ratios for special character replacement.

Properties

Methods

__construct()

public __construct(string $id, string $title, float $value) : mixed
Parameters
$id : string
$title : string
$value : float

asArray()

public asArray() : array{id: string, title: string, value: float}
Internal
Return values
array{id: string, title: string, value: float}

createMultipleFromConfiguration()

public static createMultipleFromConfiguration(array<string|int, mixed> $config) : array<int, Ratio>
Parameters
$config : array<string|int, mixed>
Tags
throws
InvalidConfigurationException
Return values
array<int, Ratio>

getId()

public getId() : string
Return values
string

getRatioValue()

public getRatioValue() : float
Return values
float

isFree()

public isFree() : bool
Return values
bool

prepareAspectRatioId()

Adjust names of Ratios for special character replacement.

public static prepareAspectRatioId(string $id) : string
Parameters
$id : string
Internal

not part of TYPO3 Core API as this method might vanish soon.

Tags
todo

in 14 - Rework the ImageManipulationElement.html logic to actually allow dot keys. Ratio names are referenced through fluid, see https://forge.typo3.org/issues/80214 Should be possible by iterating {cropVariant.allowedAspectRatios.{cropVariant.selectedRatio}.title} in the controller, and assigning a distinct, un-nested variable. This is a breaking change because then aspect ratios defined with a key will be referred to differently and wouldn't be resolved as before. Probably a migration wizard would be needed.

Return values
string

        
On this page

Search results