public static Drupal::hasRequest()
Indicates if there is a currently active request object.
bool TRUE if there is a currently active request object, FALSE otherwise.
public static function hasRequest() { // Check hasContainer() first in order to always return a Boolean. return static::hasContainer() && static::getContainer()->has('request_stack') && static::getContainer()->get('request_stack')->getCurrentRequest() !== NULL; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal.php/function/Drupal::hasRequest/8.1.x