You are here

AdvancedForm.php in UIkit Components 8.3

Same filename and directory in other branches
  1. 8.2 src/Form/AdvancedForm.php

File

src/Form/AdvancedForm.php
View source
<?php

namespace Drupal\uikit_components\Form;

use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Form builder for the UIkit Components administration advanced form.
 */
class AdvancedForm extends ConfigFormBase {

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'uikit_components_advanced_form';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {

    // Form constructor.
    $form = parent::buildForm($form, $form_state);

    // Layout.
    $form['layout'] = [
      '#type' => 'fieldset',
      '#title' => $this
        ->t('Layout'),
    ];

    // Navigations.
    $form['navigations'] = [
      '#type' => 'fieldset',
      '#title' => $this
        ->t('Navigations'),
    ];

    // Common.
    $form['common'] = [
      '#type' => 'fieldset',
      '#title' => $this
        ->t('Common'),
    ];

    // JavaScript.
    $form['javascript'] = [
      '#type' => 'fieldset',
      '#title' => $this
        ->t('JavaScript'),
    ];
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function validateForm(array &$form, FormStateInterface $form_state) {
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $config = $this
      ->config('uikit_components.advanced');
    $config
      ->save();
  }

  /**
   * {@inheritdoc}
   */
  protected function getEditableConfigNames() {
    return [
      'uikit_components.advanced',
    ];
  }

}

Classes

Namesort descending Description
AdvancedForm Form builder for the UIkit Components administration advanced form.