You are here

protected function FormBase::getRequest in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::getRequest()
  2. 9 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::getRequest()

Gets the request object.

Return value

\Symfony\Component\HttpFoundation\Request The request object.

41 calls to FormBase::getRequest()
AccountForm::form in core/modules/user/src/AccountForm.php
Gets the actual form array to be built.
AccountForm::submitForm in core/modules/user/src/AccountForm.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…
BanAdmin::validateForm in core/modules/ban/src/Form/BanAdmin.php
Form validation handler.
BlockEntitySettingTrayForm::form in core/modules/settings_tray/src/Block/BlockEntitySettingTrayForm.php
Gets the actual form array to be built.
BlockEntitySettingTrayForm::getRedirectUrl in core/modules/settings_tray/src/Block/BlockEntitySettingTrayForm.php
Gets the form's redirect URL from 'destination' provide in the request.

... See full list

File

core/lib/Drupal/Core/Form/FormBase.php, line 153

Class

FormBase
Provides a base class for forms.

Namespace

Drupal\Core\Form

Code

protected function getRequest() {
  if (!$this->requestStack) {
    $this->requestStack = \Drupal::service('request_stack');
  }
  return $this->requestStack
    ->getCurrentRequest();
}