Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
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, get
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 recordis
: True if we are looking from the symmetric ("other") side to the relationOn Symmetric Side options
: 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
.
See also
See class \TYPO3\
for how such a user function should be designed and how the options are used.