public function InstagramSettingsForm::buildForm in Media entity Instagram 3.x
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/ InstagramSettingsForm.php, line 30
Class
- InstagramSettingsForm
- Provides a form to configure Instagram credentials.
Namespace
Drupal\media_entity_instagram\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$settings = $this
->config('media_entity_instagram.settings');
$form['credentials'] = [
'#type' => 'details',
'#title' => $this
->t('Facebook credentials'),
'#description' => $this
->t('To use this module you need a Facebook developer account. In the your Facebook developer dashboard you have to create an App that uses the oEmbed API.'),
'#open' => TRUE,
];
$form['credentials']['facebook_app_id'] = [
'#type' => 'textfield',
'#title' => $this
->t('App ID'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $settings
->get('facebook_app_id'),
'#description' => $this
->t('The ID of your Facebook App.'),
];
$form['credentials']['facebook_app_secret'] = [
'#type' => 'textfield',
'#title' => $this
->t('App secret'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $settings
->get('facebook_app_secret'),
'#description' => $this
->t('The secret of your Facebook App.'),
];
return parent::buildForm($form, $form_state);
}