You are here

public function ShowTextWhenEmptyProcessor::buildConfigurationForm in Facets 8

Adds a configuration form for this processor.

Parameters

array $form: The form.

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

\Drupal\facets_summary\FacetsSummaryInterface $facets_summary: The facet summary this processor is being added to.

Overrides ProcessorPluginBase::buildConfigurationForm

File

modules/facets_summary/src/Plugin/facets_summary/processor/ShowTextWhenEmptyProcessor.php, line 55

Class

ShowTextWhenEmptyProcessor
Provides a processor that shows a text when there are no results.

Namespace

Drupal\facets_summary\Plugin\facets_summary\processor

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state, FacetsSummaryInterface $facets_summary) {

  // By default, there should be no config form.
  $config = $this
    ->getConfiguration();
  $build['text'] = [
    '#type' => 'text_format',
    '#title' => $this
      ->t('Empty text'),
    '#format' => $config['text']['format'],
    '#editor' => TRUE,
    '#default_value' => $config['text']['value'],
  ];
  return $build;
}