You are here

public function ExampleDevelGenerate::settingsForm in Devel 8.3

Same name and namespace in other branches
  1. 8 devel_generate/tests/modules/devel_generate_example/src/Plugin/DevelGenerate/ExampleDevelGenerate.php \Drupal\devel_generate_example\Plugin\DevelGenerate\ExampleDevelGenerate::settingsForm()
  2. 8.2 devel_generate/tests/modules/devel_generate_example/src/Plugin/DevelGenerate/ExampleDevelGenerate.php \Drupal\devel_generate_example\Plugin\DevelGenerate\ExampleDevelGenerate::settingsForm()
  3. 4.x devel_generate/tests/modules/devel_generate_example/src/Plugin/DevelGenerate/ExampleDevelGenerate.php \Drupal\devel_generate_example\Plugin\DevelGenerate\ExampleDevelGenerate::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/tests/modules/devel_generate_example/src/Plugin/DevelGenerate/ExampleDevelGenerate.php, line 28

Class

ExampleDevelGenerate
Provides a ExampleDevelGenerate plugin.

Namespace

Drupal\devel_generate_example\Plugin\DevelGenerate

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $form['num'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('How many examples would you like to generate?'),
    '#default_value' => $this
      ->getSetting('num'),
    '#size' => 10,
  ];
  $form['kill'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Delete all examples before generating new examples.'),
    '#default_value' => $this
      ->getSetting('kill'),
  ];
  return $form;
}