trait FormElementBaseTrait in Flexiform 8
Trait for basic form element things.
Because ContextAwarePluginBase is not split into traits.
Hierarchy
- trait \Drupal\flexiform\FormElement\FormElementBaseTrait
File
- src/
FormElement/ FormElementBaseTrait.php, line 12
Namespace
Drupal\flexiform\FormElementView source
trait FormElementBaseTrait {
/**
* {@inheritdoc}
*/
public function settingsForm(array $form, FormStateInterface $form_state) {
$form['settings'] = [
'#type' => 'container',
];
$form['settings']['label'] = [
'#type' => 'textfield',
'#title' => $this
->t('Label'),
'#description' => $this
->t('The label that will be displayed on the form.'),
'#default_value' => !empty($this->configuration['label']) ? $this->configuration['label'] : '',
];
return $form;
}
/**
* {@inheritdoc}
*/
public function settingsFormSubmit($values, array $form, FormStateInterface $form_state) {
return $values;
}
/**
* {@inheritdoc}
*/
public function settingsSummary() {
return [];
}
/**
* {@inheritdoc}
*/
public function formValidate(array $form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function formSubmit(array $form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function buildEntities(array $form, FormStateInterface $form_state) {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FormElementBaseTrait:: |
public | function | 1 | |
FormElementBaseTrait:: |
public | function | ||
FormElementBaseTrait:: |
public | function | ||
FormElementBaseTrait:: |
public | function | ||
FormElementBaseTrait:: |
public | function | ||
FormElementBaseTrait:: |
public | function |