You are here

Form.php in Cheeseburger Menu 8

Contains \Drupal\cheeseburger_menu\workForm.

File

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

/**
 * @file
 * Contains \Drupal\cheeseburger_menu\workForm.
 */
namespace Drupal\cheeseburger_menu\workForm;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class Form extends FormBase {
  private $form;
  public function insertField($form, $field, $data) {
    $form[$field] = $data;
    $this->{$form} = $form;
    return $form;
  }
  private function &getForm() {
    return $this->{$form};
  }

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return "cheeseburger_menu_form";
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    return $this->{$form};
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    drupal_set_message($this
      ->t('@emp_name ,Your application is being submitted!', array(
      '@emp_name' => $form_state
        ->getValue('employee_name'),
    )));
  }

}

Classes

Namesort descending Description
Form