You are here

public function VocabularyDevelGenerate::settingsForm in Devel 8

Same name and namespace in other branches
  1. 8.3 devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\VocabularyDevelGenerate::settingsForm()
  2. 8.2 devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\VocabularyDevelGenerate::settingsForm()
  3. 4.x devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\VocabularyDevelGenerate::settingsForm()

Returns the form for the plugin.

Return value

array The array of default setting values, keyed by setting names.

Overrides DevelGenerateBase::settingsForm

File

devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php, line 69

Class

VocabularyDevelGenerate
Provides a VocabularyDevelGenerate plugin.

Namespace

Drupal\devel_generate\Plugin\DevelGenerate

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $form['num'] = array(
    '#type' => 'number',
    '#title' => $this
      ->t('Number of vocabularies?'),
    '#default_value' => $this
      ->getSetting('num'),
    '#required' => TRUE,
    '#min' => 0,
  );
  $form['title_length'] = array(
    '#type' => 'number',
    '#title' => $this
      ->t('Maximum number of characters in vocabulary names'),
    '#default_value' => $this
      ->getSetting('title_length'),
    '#required' => TRUE,
    '#min' => 2,
    '#max' => 255,
  );
  $form['kill'] = array(
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Delete existing vocabularies before generating new ones.'),
    '#default_value' => $this
      ->getSetting('kill'),
  );
  return $form;
}