public function ContextDeleteForm::buildForm in Context 8
Same name and namespace in other branches
- 8.4 modules/context_ui/src/Form/ContextDeleteForm.php \Drupal\context_ui\Form\ContextDeleteForm::buildForm()
- 8.0 modules/context_ui/src/Form/ContextDeleteForm.php \Drupal\context_ui\Form\ContextDeleteForm::buildForm()
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
- modules/
context_ui/ src/ Form/ ContextDeleteForm.php, line 53
Class
Namespace
Drupal\context_ui\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form = parent::buildForm($form, $form_state);
// Remove the cancel button if this is an AJAX request since Drupals built
// in modal dialogues does not handle buttons that are not a primary
// button very well.
if ($this
->getRequest()
->isXmlHttpRequest()) {
unset($form['actions']['cancel']);
}
return $form;
}