You are here

public function UserIsLoggedIn::isLoggedIn in Twig Extender 8.2

Same name and namespace in other branches
  1. 8.4 src/Plugin/TwigPlugin/UserIsLoggedIn.php \Drupal\twig_extender\Plugin\TwigPlugin\UserIsLoggedIn::isLoggedIn()
  2. 8 src/Plugin/TwigPlugin/UserIsLoggedIn.php \Drupal\twig_extender\Plugin\TwigPlugin\UserIsLoggedIn::isLoggedIn()
  3. 8.3 src/Plugin/TwigPlugin/UserIsLoggedIn.php \Drupal\twig_extender\Plugin\TwigPlugin\UserIsLoggedIn::isLoggedIn()
  4. 4.x src/Plugin/TwigPlugin/UserIsLoggedIn.php \Drupal\twig_extender\Plugin\TwigPlugin\UserIsLoggedIn::isLoggedIn()

Implement user is logged in function.

File

src/Plugin/TwigPlugin/UserIsLoggedIn.php, line 23

Class

UserIsLoggedIn
The plugin for check authenticated user.

Namespace

Drupal\twig_extender\Plugin\TwigPlugin

Code

public function isLoggedIn() {
  return \Drupal::currentUser()
    ->isAuthenticated();
}