You are here

public function IsFront::front in Twig Extender 4.x

Same name and namespace in other branches
  1. 8.4 src/Plugin/TwigPlugin/IsFront.php \Drupal\twig_extender\Plugin\TwigPlugin\IsFront::front()
  2. 8.2 src/Plugin/TwigPlugin/IsFront.php \Drupal\twig_extender\Plugin\TwigPlugin\IsFront::front()
  3. 8.3 src/Plugin/TwigPlugin/IsFront.php \Drupal\twig_extender\Plugin\TwigPlugin\IsFront::front()

Implementation for render block.

File

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

Class

IsFront
The plugin for check authenticated user.

Namespace

Drupal\twig_extender\Plugin\TwigPlugin

Code

public function front() {
  return \Drupal::service('path.matcher')
    ->isFrontPage();
}