8.5.x FormBase.php FormBase::getRequest()
8.0.x FormBase.php FormBase::getRequest()
8.1.x FormBase.php FormBase::getRequest()
8.2.x FormBase.php FormBase::getRequest()
8.3.x FormBase.php FormBase::getRequest()
8.4.x FormBase.php FormBase::getRequest()
8.6.x FormBase.php FormBase::getRequest()

Gets the request object.

Return value

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

6 calls to FormBase::getRequest()
ConfirmFormBase::buildForm in core/lib/Drupal/Core/Form/ConfirmFormBase.php
Form constructor.
ContentEntityConfirmFormBase::actions in core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
Returns an array of supported actions for the current entity form.
EntityConfirmFormBase::actions in core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
Returns an array of supported actions for the current entity form.
FieldConfigEditForm::save in core/modules/field_ui/src/Form/FieldConfigEditForm.php
Form submission handler for the 'save' action.
FieldStorageConfigEditForm::save in core/modules/field_ui/src/Form/FieldStorageConfigEditForm.php
Form submission handler for the 'save' action.

... 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();
}