Form.php in Cheeseburger Menu 8
Contains \Drupal\cheeseburger_menu\workForm.
Namespace
Drupal\cheeseburger_menu\workFormFile
src/workForm/Form.phpView 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'),
)));
}
}