public function CacheflushEntityForm::buildForm in CacheFlush 8
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides EntityForm::buildForm
File
- modules/
cacheflush_ui/ src/ Entity/ Form/ CacheflushEntityForm.php, line 51
Class
- CacheflushEntityForm
- Form controller for Cacheflush entity edit forms.
Namespace
Drupal\cacheflush_ui\Entity\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
/* @var $entity \Drupal\cacheflush_entity\Entity\CacheflushEntity */
$form = parent::buildForm($form, $form_state);
$form['title'] = [
'#title' => $this
->t('Title'),
'#type' => 'textfield',
'#default_value' => $this->entity
->getTitle(),
'#required' => TRUE,
];
$this
->presetForm($form, $form_state);
return $form;
}