public function DiffFormatter::__construct

public DiffFormatter::__construct(ConfigFactoryInterface $config_factory)

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 38

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');
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Diff!DiffFormatter.php/function/DiffFormatter::__construct/8.1.x