public function GoogleApiClientSettingsForm::buildForm in Google API PHP Client 8.4
Same name and namespace in other branches
- 8.2 src/Form/GoogleApiClientSettingsForm.php \Drupal\google_api_client\Form\GoogleApiClientSettingsForm::buildForm()
- 8.3 src/Form/GoogleApiClientSettingsForm.php \Drupal\google_api_client\Form\GoogleApiClientSettingsForm::buildForm()
Define the form used for ContentEntityExample settings.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: An associative array containing the current state of the form.
Return value
array Form definition array.
Overrides FormInterface::buildForm
File
- src/
Form/ GoogleApiClientSettingsForm.php, line 50
Class
- GoogleApiClientSettingsForm
- Class ContentEntityExampleSettingsForm.
Namespace
Drupal\google_api_client\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['google_api_client_settings']['#markup'] = 'Settings form for GoogleApiClient. Manage field settings here.<br/><br/>';
$form['google_api_client_intro']['#markup'] = "GoogleApiClient tries to detect all supported services and scopes from the library installed. <br/> If you don't find your desired class/service listed or you have updated library you need to flush cache or hit 'Scan library' button, to see them here.<br/>";
$form['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Scan Library'),
];
$names = $this
->configFactory()
->get('google_api_client.google_api_services')
->get('google_api_client_google_api_services');
$form['google_api_client_services'] = [
'#theme' => 'item_list',
'#list_type' => 'ol',
'#title' => $this
->t('The supported services are:'),
'#items' => $names,
];
return $form;
}