You are here

function form_builder_get_element in Form Builder 7

Same name and namespace in other branches
  1. 6 includes/form_builder.api.inc \form_builder_get_element()

Function to retrieve a single element within a form structure.

If needing to retreive multiple elements at once, use form_builder_get_elements().

Parameters

$form: A complete hierarchical FAPI structure.

$element_id: The unique identifier for an element that is to be retrieved.

Return value

A single Form API element array.

Deprecated

Use FormBuilderFormInterface::getElement() instead. Will be removed in 2.0.

See also

form_builder_get_elements().

1 call to form_builder_get_element()
form_builder_field_render in includes/form_builder.admin.inc
Render a single field independent of other settings.

File

includes/form_builder.api.inc, line 36
form_builder.api.inc Universally used API functions within the Form builder module.

Code

function form_builder_get_element(&$form, $element_id) {
  return FormBuilderFormBase::fromArray($form)
    ->getElementArray($element_id);
}