Components for rendering user fields
Description
New API is available for user field controls rendering starting from the main module version 20.0.800.
All components and parameters can be called in the same manner; only user field type is changed.
All components contain templates for desktop and mobile apps and support options to modify control's external appearance via standard template mechanism.
The physical structure path is located at the folder /bitrix/components/bitrix/[component_name]
.
List of components
Component | Description |
---|---|
main.field.boolean | Renders boolean (yes/no) user fields. |
main.field.date | Renders date (date only) user fields. |
main.field.datetime | Renders datetime (date with time) user fields. |
main.field.double | Renders double (numeric) user field. |
main.field.enum | Renders enum (list) user fields. |
main.field.file | Renders file user fields. |
main.field.integer | Renders integer user fields. |
main.field.string | Renders string user fields. |
main.field.stringformatted | Renders stringformatted type user fields. |
main.field.url | Renders url (adderess) user fields. |
Parameters
Parameter | Description |
---|---|
$userField | Array of user field meta information. Can be fetched by the method GetUserFields of class CUserTypeManager. |
$additionalParameters | Array contains necessary settings depending on the template, used for control element's display. Specifically, this array passes the following elements:
|
Example of calling the component main.field.string
<? $APPLICATION->IncludeComponent( 'bitrix:main.field.string', '', [ 'userField' => $userField, 'additionalParameters' => $additionalParameters, ] ); ?>
Additional data
Universal API can be used as well:
$renderer = new \Bitrix\Main\UserField\Renderer($userField, $additionalParameters); return $renderer->render();
© «Bitrix24», 2001-2024