modules/acm_sku/src/Form/ProductSyncForm.php
public function buildForm(array $form, FormStateInterface $form_state) {
    $form['actions']['#type'] = 'actions';

    if ($category_vid = $this->connectorConfig->get('category_vid')) {
      $form['actions']['cats'] = [
        '#type' => 'submit',
        '#value' => t('Synchronize Categories'),
      ];
    }

    $form['actions']['products_async'] = [
      '#type' => 'submit',
      '#value' => t('Synchronize Products (async)'),
    ];

    $form['actions']['products_sync'] = [
      '#type' => 'submit',
      '#value' => t('Synchronize Products (sync)'),
    ];

    return ($form);
  }
public function buildForm(array $form, FormStateInterface $form_state) {
    $form['actions']['#type'] = 'actions';

    if ($category_vid = $this->connectorConfig->get('category_vid')) {
      $form['actions']['cats'] = [
        '#type' => 'submit',
        '#value' => t('Synchronize Categories'),
      ];
    }

    $form['actions']['products_async'] = [
      '#type' => 'submit',
      '#value' => t('Synchronize Products (async)'),
    ];

    $form['actions']['products_sync'] = [
      '#type' => 'submit',
      '#value' => t('Synchronize Products (sync)'),
    ];

    return ($form);
  }
public function buildForm ( array $ form , FormStateInterface $ form_state ) { $ form [ 'actions' ] [ '#type' ] = 'actions' ; if ( $ category_vid = $ this -> connectorConfig -> get ( 'category_vid' ) ) { $ form [ 'actions' ] [ 'cats' ] = [ '#type' => 'submit' , '#value' => t ( 'Synchronize Categories' ) , ] ; } $ form [ 'actions' ] [ 'products_async' ] = [ '#type' => 'submit' , '#value' => t ( 'Synchronize Products (async)' ) , ] ; $ form [ 'actions' ] [ 'products_sync' ] = [ '#type' => 'submit' , '#value' => t ( 'Synchronize Products (sync)' ) , ] ; return ( $ form ) ; }
Define the form used for settings.

@param array $form
An associative array containing the structure of the form.
@param \Drupal\Core\Form\FormStateInterface $form_state
An associative array containing the current state of the form.

@return array
Form definition array.
Define the form used for settings .