public function ExampleDevelGenerate::settingsForm in Devel 4.x
Same name and namespace in other branches
- 8.3 devel_generate/tests/modules/devel_generate_example/src/Plugin/DevelGenerate/ExampleDevelGenerate.php \Drupal\devel_generate_example\Plugin\DevelGenerate\ExampleDevelGenerate::settingsForm()
- 8 devel_generate/tests/modules/devel_generate_example/src/Plugin/DevelGenerate/ExampleDevelGenerate.php \Drupal\devel_generate_example\Plugin\DevelGenerate\ExampleDevelGenerate::settingsForm()
- 8.2 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\DevelGenerateCode
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;
}