public static Drupal::hasRequest()
Indicates if there is a currently active request object.
Return value
bool TRUE if there is a currently active request object, FALSE otherwise.
File
- core/lib/Drupal.php, line 190
- Contains \Drupal.
Class
- Drupal
- Static Service Container wrapper.
Code
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; }
Please login to continue.