public function ProcessorFormBase::form in Production check & Production monitor 8
Gets the actual form array to be built.
Overrides EntityForm::form
See also
\Drupal\Core\Entity\EntityForm::processForm()
\Drupal\Core\Entity\EntityForm::afterBuild()
File
- src/
Form/ ProcessorFormBase.php, line 60
Class
- ProcessorFormBase
- Provides a base form for processor forms.
Namespace
Drupal\prod_check\FormCode
public function form(array $form, FormStateInterface $form_state) {
$form['label'] = [
'#type' => 'textfield',
'#title' => $this
->t('Label'),
'#default_value' => $this->entity
->label(),
'#maxlength' => '255',
'#description' => $this
->t('A unique label for this advanced processor. This label will be displayed in the interface of modules that integrate with prod check processors.'),
];
$form['id'] = [
'#type' => 'machine_name',
'#default_value' => $this->entity
->id(),
'#disabled' => !$this->entity
->isNew(),
'#maxlength' => 64,
'#description' => $this
->t('A unique name for this processor. It must only contain lowercase letters, numbers and underscores.'),
'#machine_name' => [
'exists' => [
$this,
'exists',
],
],
];
$form['plugin'] = [
'#type' => 'value',
'#value' => $this->entity
->get('plugin'),
];
if ($this->plugin instanceof PluginFormInterface) {
$form += $this->plugin
->buildConfigurationForm($form, $form_state);
}
return parent::form($form, $form_state);
}