You are here

public function AjaxFormBlock::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/ajax_forms_test/src/Plugin/Block/AjaxFormBlock.php \Drupal\ajax_forms_test\Plugin\Block\AjaxFormBlock::__construct()
  2. 10 core/modules/system/tests/modules/ajax_forms_test/src/Plugin/Block/AjaxFormBlock.php \Drupal\ajax_forms_test\Plugin\Block\AjaxFormBlock::__construct()

Constructs a new AjaxFormBlock.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Form\FormBuilderInterface $form_builder: The form builder.

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger.

Overrides BlockPluginTrait::__construct

File

core/modules/system/tests/modules/ajax_forms_test/src/Plugin/Block/AjaxFormBlock.php, line 52

Class

AjaxFormBlock
Provides an AJAX form block.

Namespace

Drupal\ajax_forms_test\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, FormBuilderInterface $form_builder, MessengerInterface $messenger) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->formBuilder = $form_builder;
  $this->messenger = $messenger;
}