You are here

public function TwigExtension::setDateFormatter in Drupal 8

Sets the date formatter.

Parameters

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

Return value

$this

Deprecated

in drupal:8.3.0 and is removed from drupal:9.0.0.

File

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

Class

TwigExtension
A class providing Drupal Twig extensions.

Namespace

Drupal\Core\Template

Code

public function setDateFormatter(DateFormatterInterface $date_formatter) {
  $this->dateFormatter = $date_formatter;
  return $this;
}