modules/acm_customer/src/Plugin/CustomerForm/Profile.php
public function addEditButton(array &$field, $field_name) {
    $field['#buttons']['edit'] = [
      '#type' => 'link',
      '#title' => $this->t('Edit'),
      '#url' => Url::fromRoute('acm_customer.view_page', [
        'page' => $this->getPageId(),
        'action' => 'edit',
        'id' => $field_name,
      ]),
      '#attributes' => [
        'class' => [
          'form-item__edit-button',
        ],
      ],
    ];
  }
public function addEditButton(array &$field, $field_name) {
    $field['#buttons']['edit'] = [
      '#type' => 'link',
      '#title' => $this->t('Edit'),
      '#url' => Url::fromRoute('acm_customer.view_page', [
        'page' => $this->getPageId(),
        'action' => 'edit',
        'id' => $field_name,
      ]),
      '#attributes' => [
        'class' => [
          'form-item__edit-button',
        ],
      ],
    ];
  }
public function addEditButton ( array & $ field , $ field_name ) { $ field [ '#buttons' ] [ 'edit' ] = [ '#type' => 'link' , '#title' => $ this -> t ( 'Edit' ) , '#url' => Url :: fromRoute ( 'acm_customer.view_page' , [ 'page' => $ this -> getPageId ( ) , 'action' => 'edit' , 'id' => $ field_name , ] ) , '#attributes' => [ 'class' => [ 'form-item__edit-button' , ] , ] , ] ; }
Adds an edit button to a form field.

@param array $field
The form field.
@param string $field_name
The name of the form field.
Adds an edit button to a form field .