public function PhotoswipeAdminSettings::buildForm in PhotoSwipe 8
Same name and namespace in other branches
- 8.2 src/Form/PhotoswipeAdminSettings.php \Drupal\photoswipe\Form\PhotoswipeAdminSettings::buildForm()
- 3.x src/Form/PhotoswipeAdminSettings.php \Drupal\photoswipe\Form\PhotoswipeAdminSettings::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/ PhotoswipeAdminSettings.php, line 49
Class
Namespace
Drupal\photoswipe\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['photoswipe_always_load_non_admin'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Load PhotoSwipe on all non-admin pages'),
'#default_value' => \Drupal::config('photoswipe.settings')
->get('photoswipe_always_load_non_admin'),
'#description' => $this
->t('Useful if you want to use photoswipe elsewhere by just adding the <code>.photoswipe</code> CSS class.'),
];
return parent::buildForm($form, $form_state);
}