public function DeleteForm::buildForm in bootstrap simple carousel 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 ConfirmFormBase::buildForm
File
- src/
Form/ DeleteForm.php, line 87
Class
- DeleteForm
- Class DeleteForm.
Namespace
Drupal\bootstrap_simple_carousel\FormCode
public function buildForm(array $form, FormStateInterface $form_state, $id = NULL) {
$form = parent::buildForm($form, $form_state);
if (is_numeric($id)) {
$this->entity = $this->carouselItemStorage
->load($id);
}
if (!is_null($this->entity)) {
$form['cid'] = [
'#type' => 'hidden',
'#required' => FALSE,
'#default_value' => $this->entity
->id(),
];
$form['image_id'] = [
'#type' => 'hidden',
'#required' => FALSE,
'#default_value' => $this->entity
->getImageId(),
];
}
return $form;
}