public function ConfigurationForm::buildForm in Firebase Push Notification (FCM) 8
Same name and namespace in other branches
- 3.0.x src/Form/ConfigurationForm.php \Drupal\firebase\Form\ConfigurationForm::buildForm()
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides ConfigFormBase::buildForm
File
- src/
Form/ ConfigurationForm.php, line 35
Class
- ConfigurationForm
- Implements Firebase API configuration.
Namespace
Drupal\firebase\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('firebase.settings');
$form['firebase'] = [
'#type' => 'details',
'#title' => $this
->t('Configure Firebase'),
'#open' => TRUE,
];
$form['firebase']['server_key'] = [
'#type' => 'textarea',
'#title' => $this
->t('Firebase Server Key'),
'#description' => $this
->t('This is the server key. <em>Do not confuse with API Key</em>'),
'#default_value' => $config
->get('server_key'),
'#required' => TRUE,
];
$form['firebase']['sender_id'] = [
'#type' => 'textfield',
'#title' => $this
->t('Sender ID'),
'#description' => $this
->t('Required for group managing service.'),
'#default_value' => $config
->get('sender_id'),
'#required' => TRUE,
];
return parent::buildForm($form, $form_state);
}