public function VocabularyDevelGenerate::settingsForm in Devel 4.x
Same name and namespace in other branches
- 8.3 devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\VocabularyDevelGenerate::settingsForm()
- 8 devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\VocabularyDevelGenerate::settingsForm()
- 8.2 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 68
Class
- VocabularyDevelGenerate
- Provides a VocabularyDevelGenerate plugin.
Namespace
Drupal\devel_generate\Plugin\DevelGenerateCode
public function settingsForm(array $form, FormStateInterface $form_state) {
$form['num'] = [
'#type' => 'number',
'#title' => $this
->t('Number of vocabularies?'),
'#default_value' => $this
->getSetting('num'),
'#required' => TRUE,
'#min' => 0,
];
$form['title_length'] = [
'#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'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Delete existing vocabularies before generating new ones.'),
'#default_value' => $this
->getSetting('kill'),
];
return $form;
}