validation

validation
Path

$GLOBALS['TCA'][$table]['columns'][$field]['config']

type

array

Scope

Proc.

Values for the eval rules. The keys of the array must correspond to the keyword of the related evaluation rule. For maximumRecordsChecked and maximumRecordsCheckedInPid the value is expected to be an integer.

Examples

Only one record can be checked

In the example below, only one record from the same table will be allowed to have that particular box checked.

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'checkbox_8' => [
            'exclude' => 1,
            'label' => 'checkbox_8',
            'description' => 'eval=maximumRecordsCheckedInPid, for this PID',
            'config' => [
                'type' => 'check',
                'eval' => 'maximumRecordsCheckedInPid',
                'validation' => [
                    'maximumRecordsCheckedInPid' => 1,
                ],
            ],
        ],
    ],
]
Copied!