dbFieldLength¶
New in version 13.0
As TYPO3 takes care of
generating the according database field
for select
fields since TYPO3 v13, a developer can adjust the length
of the database field with this option in TCA directly.
-
dbFieldLength
¶ -
- Type
- integer
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']
- Default
- 255
- Scope
- Proc.
- RenderType
- all
The TCA config option
dbFieldLength
has contains an integer value that is applied tovarchar
fields (nottext
) and defines the length of the database field. It will not be respected for fields that resolve to an integer type. Developers who wish to optimize field length can usedbFieldLength
fortype=select
fields to increase or decrease the default length.
Example¶
'my_field' => [
'label' => 'My field',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['label' => '', 'value' => ''],
['label' => 'Some label', 'value' => 'some'],
['label' => 'Another label', 'value' => 'another'],
],
'default' => '',
'dbFieldLength' => 10,
],
Copied!