public function PageUrlQrCodeBlock::blockSubmit in Page URL QR Code Block 8
Adds block type-specific submission handling for the block form.
Note that this method takes the form structure and form state for the full block configuration form as arguments, not just the elements defined in BlockPluginInterface::blockForm().
Parameters
array $form: The form definition array for the full block configuration form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides BlockPluginTrait::blockSubmit
See also
\Drupal\Core\Block\BlockPluginInterface::blockForm()
\Drupal\Core\Block\BlockPluginInterface::blockValidate()
File
- src/
Plugin/ Block/ PageUrlQrCodeBlock.php, line 91 - Contains \Drupal\page_url_qr_code_block\Plugin\Block\page_url_qr_code_block.
Class
- PageUrlQrCodeBlock
- Provides my custom block.
Namespace
Drupal\page_url_qr_code_block\Plugin\BlockCode
public function blockSubmit($form, FormStateInterface $form_state) {
$this->configuration['page_url_qr_code_caption'] = $form_state
->getValue('page_url_qr_code_caption');
$this->configuration['page_url_qr_code_alt'] = $form_state
->getValue('page_url_qr_code_alt');
$this->configuration['page_url_qr_code_width_height'] = $form_state
->getValue('page_url_qr_code_width_height');
$this->configuration['page_url_qr_code_api'] = $form_state
->getValue('page_url_qr_code_api');
}