function DiffFormatter::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Diff/DiffFormatter.php \Drupal\Core\Diff\DiffFormatter::__construct()
  2. 8.9.x core/lib/Drupal/Core/Diff/DiffFormatter.php \Drupal\Core\Diff\DiffFormatter::__construct()
  3. 11.x core/lib/Drupal/Core/Diff/DiffFormatter.php \Drupal\Core\Diff\DiffFormatter::__construct()

Creates a DiffFormatter to render diffs in a table.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

File

core/lib/Drupal/Core/Diff/DiffFormatter.php, line 30

Class

DiffFormatter
Diff formatter which uses returns output that can be rendered to a table.

Namespace

Drupal\Core\Diff

Code

public function __construct(ConfigFactoryInterface $config_factory) {
    $config = $config_factory->get('system.diff');
    $this->leading_context_lines = $config->get('context.lines_leading');
    $this->trailing_context_lines = $config->get('context.lines_trailing');
}

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