Adds a "Connect" button to a form.
array A form array containing "Connect" button.
public function addConnectButton() {
$form['connect'] = array(
'#type' => 'submit',
'#value' => t('Connect'),
'#submit' => [
[
TranslatorForm::class,
'updateRemoteLanguagesMappings',
],
[
$this,
'submitConnect',
],
],
'#limit_validation_errors' => array(
array(
'settings',
),
),
'#executes_submit_callback' => TRUE,
'#ajax' => [
'callback' => [
TranslatorForm::class,
'ajaxTranslatorPluginSelect',
],
'wrapper' => 'tmgmt-plugin-wrapper',
],
);
return $form;
}