You are here

public function ForwardFormBlock::__construct in Forward 8.3

Same name and namespace in other branches
  1. 8 src/Plugin/Block/ForwardFormBlock.php \Drupal\forward\Plugin\Block\ForwardFormBlock::__construct()
  2. 8.2 src/Plugin/Block/ForwardFormBlock.php \Drupal\forward\Plugin\Block\ForwardFormBlock::__construct()

Constructs a new ForwardLinkBlock object.

Parameters

array $configuration:

string $plugin_id:

mixed $plugin_definition:

\Drupal\forward\ForwardAccessCheckerInterface $access_checker:

\Drupal\forward\ForwardFormBuilderInterface $form_builder:

\Drupal\Core\Config\ConfigFactoryInterface $config_factory:

\Drupal\Core\Routing\RouteMatchInterface $route_match:

Overrides BlockPluginTrait::__construct

File

src/Plugin/Block/ForwardFormBlock.php, line 79
Contains \Drupal\forward\Plugin\Block\ForwardFormBlock.

Class

ForwardFormBlock
Provides a block for switching users.

Namespace

Drupal\forward\Plugin\Block

Code

public function __construct($configuration, $plugin_id, $plugin_definition, ForwardAccessCheckerInterface $access_checker, ForwardFormBuilderInterface $form_builder, ConfigFactoryInterface $config_factory, RouteMatchInterface $route_match) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->accessChecker = $access_checker;
  $this->formBuilder = $form_builder;
  $this->routeMatch = $route_match;

  // Force the "form" interface.
  $settings = $config_factory
    ->get('forward.settings')
    ->get();
  $settings['forward_interface_type'] = 'form';
  $this->settings = $settings;
}