function FormHooks::isModalOrOffcanvas

Same name in this branch
  1. main core/themes/admin/src/Hook/FormHooks.php \Drupal\admin\Hook\FormHooks::isModalOrOffcanvas()
Same name and namespace in other branches
  1. 11.x core/themes/admin/src/Hook/FormHooks.php \Drupal\admin\Hook\FormHooks::isModalOrOffcanvas()
  2. 11.x core/themes/default_admin/src/Hook/FormHooks.php \Drupal\default_admin\Hook\FormHooks::isModalOrOffcanvas()

Check the context we're in.

Checks if the form is in either a modal or an off-canvas dialog.

1 call to FormHooks::isModalOrOffcanvas()
FormHooks::stickyActionButtonsAndSidebar in core/themes/default_admin/src/Hook/FormHooks.php
Add some major form overrides.

File

core/themes/default_admin/src/Hook/FormHooks.php, line 805

Class

FormHooks
Provides form related hook implementations.

Namespace

Drupal\default_admin\Hook

Code

private function isModalOrOffcanvas() : bool {
  $wrapper_format = $this->getRequestWrapperFormat() ?? '';
  return str_contains($wrapper_format, 'drupal_modal') || str_contains($wrapper_format, 'drupal_dialog');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.