modules/acm_customer/src/Plugin/CustomerForm/Profile.php
public function addSaveButtons(array &$field, $field_name) {
    $field['#display_value'] = FALSE;
    $field['#buttons']['cancel'] = [
      '#type' => 'link',
      '#title' => $this->t('Cancel'),
      '#url' => Url::fromRoute('acm_customer.view_page', [
        'page' => $this->getPageId(),
      ]),
      '#attributes' => [
        'class' => [
          'form-item__cancel-button',
        ],
      ],
    ];
    $field['#buttons']['save'] = [
      '#type' => 'submit',
      '#value' => $this->t('Save'),
      '#submit' => ['::submitForm'],
      '#attributes' => [
        'class' => [
          'form-item__save-button',
        ],
      ],
    ];
  }
public function addSaveButtons(array &$field, $field_name) {
    $field['#display_value'] = FALSE;
    $field['#buttons']['cancel'] = [
      '#type' => 'link',
      '#title' => $this->t('Cancel'),
      '#url' => Url::fromRoute('acm_customer.view_page', [
        'page' => $this->getPageId(),
      ]),
      '#attributes' => [
        'class' => [
          'form-item__cancel-button',
        ],
      ],
    ];
    $field['#buttons']['save'] = [
      '#type' => 'submit',
      '#value' => $this->t('Save'),
      '#submit' => ['::submitForm'],
      '#attributes' => [
        'class' => [
          'form-item__save-button',
        ],
      ],
    ];
  }
public function addSaveButtons ( array & $ field , $ field_name ) { $ field [ '#display_value' ] = FALSE ; $ field [ '#buttons' ] [ 'cancel' ] = [ '#type' => 'link' , '#title' => $ this -> t ( 'Cancel' ) , '#url' => Url :: fromRoute ( 'acm_customer.view_page' , [ 'page' => $ this -> getPageId ( ) , ] ) , '#attributes' => [ 'class' => [ 'form-item__cancel-button' , ] , ] , ] ; $ field [ '#buttons' ] [ 'save' ] = [ '#type' => 'submit' , '#value' => $ this -> t ( 'Save' ) , '#submit' => [ '::submitForm' ] , '#attributes' => [ 'class' => [ 'form-item__save-button' , ] , ] , ] ; }
Adds a save and cancel button to a form field.

@param array $field
The form field.
@param string $field_name
The name of the form field.
Adds a save and cancel button to a form field .