You are here

public function WidgetPluginBase::buildConfigurationForm in Facets 8

Provides a configuration form for this widget.

Parameters

array $form: A form API form array.

\Drupal\Core\Form\FormStateInterface $form_state: The form state object.

\Drupal\facets\FacetInterface $facet: The facet entitu.

Return value

array A renderable form array.

Overrides WidgetPluginInterface::buildConfigurationForm

3 calls to WidgetPluginBase::buildConfigurationForm()
DropdownWidget::buildConfigurationForm in src/Plugin/facets/widget/DropdownWidget.php
Provides a configuration form for this widget.
LinksWidget::buildConfigurationForm in src/Plugin/facets/widget/LinksWidget.php
Provides a configuration form for this widget.
SliderWidget::buildConfigurationForm in modules/facets_range_widget/src/Plugin/facets/widget/SliderWidget.php
Provides a configuration form for this widget.
3 methods override WidgetPluginBase::buildConfigurationForm()
DropdownWidget::buildConfigurationForm in src/Plugin/facets/widget/DropdownWidget.php
Provides a configuration form for this widget.
LinksWidget::buildConfigurationForm in src/Plugin/facets/widget/LinksWidget.php
Provides a configuration form for this widget.
SliderWidget::buildConfigurationForm in modules/facets_range_widget/src/Plugin/facets/widget/SliderWidget.php
Provides a configuration form for this widget.

File

src/Widget/WidgetPluginBase.php, line 146

Class

WidgetPluginBase
A base class for widgets that implements most of the boilerplate.

Namespace

Drupal\facets\Widget

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state, FacetInterface $facet) {
  $form['show_numbers'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Show the amount of results'),
    '#default_value' => $this
      ->getConfiguration()['show_numbers'],
  ];
  return $form;
}