function SettingsForm::__construct

Same name in other branches
  1. 8.9.x core/modules/aggregator/src/Form/SettingsForm.php \Drupal\aggregator\Form\SettingsForm::__construct()
  2. 11.x core/modules/navigation/src/Form/SettingsForm.php \Drupal\navigation\Form\SettingsForm::__construct()
  3. 10 core/modules/navigation/src/Form/SettingsForm.php \Drupal\navigation\Form\SettingsForm::__construct()

Constructs a \Drupal\aggregator\SettingsForm object.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The factory for configuration objects.

\Drupal\aggregator\Plugin\AggregatorPluginManager $fetcher_manager: The aggregator fetcher plugin manager.

\Drupal\aggregator\Plugin\AggregatorPluginManager $parser_manager: The aggregator parser plugin manager.

\Drupal\aggregator\Plugin\AggregatorPluginManager $processor_manager: The aggregator processor plugin manager.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation manager.

Overrides ConfigFormBase::__construct

File

core/modules/aggregator/src/Form/SettingsForm.php, line 60

Class

SettingsForm
Configures aggregator settings for this site.

Namespace

Drupal\aggregator\Form

Code

public function __construct(ConfigFactoryInterface $config_factory, AggregatorPluginManager $fetcher_manager, AggregatorPluginManager $parser_manager, AggregatorPluginManager $processor_manager, TranslationInterface $string_translation) {
    parent::__construct($config_factory);
    $this->stringTranslation = $string_translation;
    $this->managers = [
        'fetcher' => $fetcher_manager,
        'parser' => $parser_manager,
        'processor' => $processor_manager,
    ];
    // Get all available fetcher, parser and processor definitions.
    foreach ([
        'fetcher',
        'parser',
        'processor',
    ] as $type) {
        foreach ($this->managers[$type]
            ->getDefinitions() as $id => $definition) {
            $this->definitions[$type][$id] = new FormattableMarkup('@title <span class="description">@description</span>', [
                '@title' => $definition['title'],
                '@description' => $definition['description'],
            ]);
        }
    }
}

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