public function TestFieldWidget::settingsForm in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidget.php \Drupal\field_test\Plugin\Field\FieldWidget\TestFieldWidget::settingsForm()
Returns a form to configure settings for the widget.
Invoked from \Drupal\field_ui\Form\EntityDisplayFormBase to allow administrators to configure the widget. The field_ui module takes care of handling submitted form values.
Parameters
array $form: The form where the settings form is being included in.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form definition for the widget settings.
Overrides WidgetBase::settingsForm
File
- core/
modules/ field/ tests/ modules/ field_test/ src/ Plugin/ Field/ FieldWidget/ TestFieldWidget.php, line 45 - Contains \Drupal\field_test\Plugin\Field\FieldWidget\TestFieldWidget.
Class
- TestFieldWidget
- Plugin implementation of the 'test_field_widget' widget.
Namespace
Drupal\field_test\Plugin\Field\FieldWidgetCode
public function settingsForm(array $form, FormStateInterface $form_state) {
$element['test_widget_setting'] = array(
'#type' => 'textfield',
'#title' => t('Field test field widget setting'),
'#description' => t('A dummy form element to simulate field widget setting.'),
'#default_value' => $this
->getSetting('test_widget_setting'),
'#required' => FALSE,
);
return $element;
}