AdminForm.php in Openlayers 8.4
File
src/Form/AdminForm.php
View source
<?php
namespace Drupal\openlayers\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
class AdminForm extends ConfigFormBase {
protected function getEditableConfigNames() {
return [
'openlayers.adminsettings',
];
}
public function getFormId() {
return 'openlayers_admin_form';
}
public function buildForm(array $form, FormStateInterface $form_state) {
$form['main'] = [
'#type' => 'markup',
'#markup' => $this
->t('TODO: Main admin screen'),
];
$form['actions']['reset'] = [
'#type' => 'submit',
'#value' => $this
->t('Reset to defaults'),
'#name' => 'reset',
'#button_type' => 'primary',
'#weight' => 10,
];
return parent::buildForm($form, $form_state);
}
public function submitForm(array &$form, FormStateInterface $form_state) {
}
}
Classes
Name |
Description |
AdminForm |
Contains the Admin Form for the Openlayers module. |