public function Property::form in Form Builder 7.2
Same name in this branch
- 7.2 examples/src/Property.php \Drupal\form_builder_examples\Property::form()
- 7.2 modules/webform/src/Property.php \Drupal\form_builder_webform\Property::form()
Generate form-API elements for editing this property.
Parameters
array $form_state: Form API form_state of the field configure form.
\Drupal\form_builder\ElementInterface $element: The currently stored element. Use this to get the "current" values.
Return value
array Form-API array that will be merged into the field configure form.
File
- modules/
webform/ src/ Property.php, line 38
Class
Namespace
Drupal\form_builder_webformCode
public function form($component, $edit, &$form_state) {
// Set weight to just anything. Element positions aren't configured in
// this way in form_builder.
$component['weight'] = 0;
if (isset($this->params['form']) && function_exists($this->params['form'])) {
$function = $this->params['form'];
return $function($component, $edit, $form_state, $this->property);
}
return array();
}