Number¶
New in version 12.0: The TCA type number
has been introduced. It replaces the
eval=int
and eval=double2
options of TCA type input
.
The TCA type number
should be used to input values representing numbers.
Note
The slider option allows to define a visual slider element, next to the input field. The steps can be defined with the slider[step] option. The minimum and maximum value can be configured with the range[lower] and range[upper] options.
Migration¶
Migration from eval='int'¶
The migration from eval='int'
to type=number
is done like following:
// Before
'int_field' => [
'label' => 'Int field',
'config' => [
'type' => 'input',
'eval' => 'int',
]
]
// After
'int_field' => [
'label' => 'Int field',
'config' => [
'type' => 'number',
]
]
Migration from eval='double2'¶
The migration from eval=double2
to type=number
is done like following:
// Before
'double2_field' => [
'label' => 'double2 field',
'config' => [
'type' => 'input',
'eval' => 'double2',
]
]
// After
'double2_field' => [
'label' => 'double2 field',
'config' => [
'type' => 'number',
'format' => 'decimal'
]
]
An automatic TCA migration is performed on the fly, migrating all occurrences
to the new TCA type and triggering a PHP E_USER_DEPRECATED
error
where code adoption has to take place.