public function BgImageFieldWidget::settingsForm in Background Image Field 8
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 ImageWidget::settingsForm
File
- src/Plugin/ Field/ FieldWidget/ BgImageFieldWidget.php, line 179 
Class
- BgImageFieldWidget
- Plugin implementation of the 'image_image' widget.
Namespace
Drupal\bg_img_field\Plugin\Field\FieldWidgetCode
public function settingsForm(array $form, FormStateInterface $form_state) {
  $element = parent::settingsForm($form, $form_state);
  $element['hide_css_settings'] = [
    '#type' => 'checkbox',
    '#title' => t("Hide CSS Settings"),
    '#description' => t("Do not show CSS settings when creating content \n      on nodes, blocks, custom entities, media,  and paragraph items"),
    '#default_value' => $this
      ->getSetting('hide_css_settings'),
  ];
  return $element;
}