You are here

public function JSON::buildConfigurationForm in Search API Synonym 8

Plugin configuration form.

Parameters

array $form: Form array.

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

Return value

array Form array.

Overrides ImportPluginBase::buildConfigurationForm

File

src/Plugin/search_api_synonym/import/JSON.php, line 49

Class

JSON
Import of JSON files.

Namespace

Drupal\search_api_synonym\Plugin\search_api_synonym\import

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $example_url = 'internal:' . base_path() . drupal_get_path('module', 'search_api_synonym') . '/examples/example.json';
  $form['template'] = [
    '#type' => 'item',
    '#title' => $this
      ->t('Example'),
    '#markup' => Link::fromTextAndUrl(t('Download example file'), Url::fromUri($example_url))
      ->toString(),
  ];
  return $form;
}