function DateFormatter::__construct

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Datetime/DateFormatter.php \Drupal\Core\Datetime\DateFormatter::__construct()
  2. 9 core/lib/Drupal/Core/Datetime/DateFormatter.php \Drupal\Core\Datetime\DateFormatter::__construct()
  3. 8.9.x core/lib/Drupal/Core/Datetime/DateFormatter.php \Drupal\Core\Datetime\DateFormatter::__construct()

File

core/lib/Drupal/Core/Datetime/DateFormatter.php, line 54

Class

DateFormatter
Provides a service to handle various date related functionality.

Namespace

Drupal\Core\Datetime

Code

public function __construct(protected EntityTypeManagerInterface $entityTypeManager, protected LanguageManagerInterface $languageManager, TranslationInterface $translation, protected ConfigFactoryInterface $configFactory, protected RequestStack $requestStack) {
  $this->stringTranslation = $translation;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.