1
0
Files
re_capitulating_queer/kirby/config/fields/range.php
Philip Wagner 78b6c0d381 init
2024-08-31 10:01:49 +02:00

34 lines
679 B
PHP

<?php
use Kirby\Toolkit\I18n;
return [
'extends' => 'number',
'props' => [
/**
* Unset inherited props
*/
'placeholder' => null,
/**
* The maximum value on the slider
*/
'max' => function (float $max = 100) {
return $max;
},
/**
* Enables/disables the tooltip and set the before and after values
*/
'tooltip' => function ($tooltip = true) {
if (is_array($tooltip) === true) {
$after = $tooltip['after'] ?? null;
$before = $tooltip['before'] ?? null;
$tooltip['after'] = I18n::translate($after, $after);
$tooltip['before'] = I18n::translate($before, $before);
}
return $tooltip;
},
]
];