You are here

public function TwigExtension::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Template/TwigExtension.php \Drupal\Core\Template\TwigExtension::__construct()

Constructs \Drupal\Core\Template\TwigExtension.

Parameters

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

\Drupal\Core\Routing\UrlGeneratorInterface $url_generator: The URL generator.

\Drupal\Core\Theme\ThemeManagerInterface $theme_manager: The theme manager.

\Drupal\Core\Datetime\DateFormatterInterface $date_formatter: The date formatter.

File

core/lib/Drupal/Core/Template/TwigExtension.php, line 68

Class

TwigExtension
A class providing Drupal Twig extensions.

Namespace

Drupal\Core\Template

Code

public function __construct(RendererInterface $renderer, UrlGeneratorInterface $url_generator, ThemeManagerInterface $theme_manager, DateFormatterInterface $date_formatter) {
  $this->renderer = $renderer;
  $this->urlGenerator = $url_generator;
  $this->themeManager = $theme_manager;
  $this->dateFormatter = $date_formatter;
}