submitLabel example

$this->block = $component->getPlugin();

    $form_state->setTemporaryValue('gathered_contexts', $this->getPopulatedContexts($section_storage));

    $form['#tree'] = TRUE;
    $form['settings'] = [];
    $subform_state = SubformState::createForSubform($form['settings']$form$form_state);
    $form['settings'] = $this->getPluginForm($this->block)->buildConfigurationForm($form['settings']$subform_state);

    $form['actions']['submit'] = [
      '#type' => 'submit',
      '#value' => $this->submitLabel(),
      '#button_type' => 'primary',
    ];
    if ($this->isAjax()) {
      $form['actions']['submit']['#ajax']['callback'] = '::ajaxSubmit';
      // @todo static::ajaxSubmit() requires data-drupal-selector to be the same       // between the various Ajax requests. A bug in       // \Drupal\Core\Form\FormBuilder prevents that from happening unless       // $form['#id'] is also the same. Normally, #id is set to a unique HTML       // ID via Html::getUniqueId(), but here we bypass that in order to work       // around the data-drupal-selector bug. This is okay so long as we       // assume that this form only ever occurs once on a page. Remove this
Home | Imprint | This part of the site doesn't use cookies.