public function SliderProDeleteForm::buildForm in Slider Pro 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 EntityConfirmFormBase::buildForm
File
- src/
Form/ SliderProDeleteForm.php, line 56
Class
- SliderProDeleteForm
- Class SliderProDeleteForm @package Drupal\slider_pro\Form
Namespace
Drupal\slider_pro\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form = parent::buildForm($form, $form_state);
if ($this->entity
->id() == 'default') {
$form['#title'] = $this
->t('The default optionset cannot be deleted.');
$form['description'] = [
'#markup' => t('Please click Cancel to go back to the list of optionsets.'),
];
$form['actions']['submit']['#access'] = FALSE;
}
return $form;
}