FormBase::getRequest

protected FormBase::getRequest()

Gets the request object.

Return value

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

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();
}
doc_Drupal
2016-10-29 09:15:18
Comments
Leave a Comment

Please login to continue.