CoreForm.php in UIkit Components 8.2
File
src/Form/CoreForm.php
View source
<?php
namespace Drupal\uikit_components\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
class CoreForm extends ConfigFormBase {
public function getFormId() {
return 'uikit_components_core_form';
}
public function buildForm(array $form, FormStateInterface $form_state) {
$form = parent::buildForm($form, $form_state);
$form['layout'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Layout'),
];
$form['navigations'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Navigations'),
];
$form['elements'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Elements'),
];
$form['common'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Common'),
];
$form['javascript'] = [
'#type' => 'fieldset',
'#title' => $this
->t('JavaScript'),
];
return $form;
}
public function validateForm(array &$form, FormStateInterface $form_state) {
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('uikit_components.core');
$config
->save();
}
protected function getEditableConfigNames() {
return [
'uikit_components.core',
];
}
}