formattedLabel_userFunc¶
-
formattedLabel_userFunc
¶ -
- Type
- string
- Path
- $GLOBALS['TCA'][$table]['ctrl']
- Scope
- Display
Similar to label_userFunc but allows to return formatted HTML for the label and is used only for the labels of inline (IRRE) records. The referenced user function may receive optional arguments using the formattedLabel_userFunc_options property.
Tip
Read more about Inline Relational Record Editing (IRRE).
Examples¶
-
Example from table "sys_file_reference":
'formattedLabel_userFunc' => TYPO3\CMS\Core\Resource\Service\UserFileInlineLabelService::class . '->getInlineLabel', 'formattedLabel_userFunc_options' => [ 'sys_file' => [ 'title', 'name' ] ],
Copied!
In this example, getInlineLabel
will be called with an array of $parameters
which is passed by reference.
This array consists of the following keys (and values):
table
: The table name of the current recordrow
: The database row of the current recordisOnSymmetricSide
: True if we are looking from the symmetric ("other") side to the relationoptions
: The options configured in TCA - see formattedLabel_userFunc_optionsparent
: Contains another array with the keysuid
(referencing the inline child's parent uid) andconfig
(referencing the parent configuration)title
: Initialized to an empty string, this is the title that is manipulated by the user function
The resulting title must be written to $parameters['title']
.
See also
See class \TYPO3\CMS\Core\Resource\Service\UserFileInlineLabelService
for how such a user function should be designed and how the options are used.