Skip to content

Instantly share code, notes, and snippets.

@adityaanurag
Created July 4, 2016 19:15
Show Gist options
  • Save adityaanurag/755c77f4db60f9ac54c3edfc51561f91 to your computer and use it in GitHub Desktop.
Save adityaanurag/755c77f4db60f9ac54c3edfc51561f91 to your computer and use it in GitHub Desktop.
<?php
namespace Drupal\manage_inventory\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class InventorySettingsForm.
* @package Drupal\manage_inventory\Form
* @ingroup manage_inventory
*/
class InventorySettingsForm extends FormBase {
/**
* Returns a unique string identifying the form.
*
* @return string
* The unique string identifying the form.
*/
public function getFormId() {
return 'inventory_settings';
}
/**
* Form submission handler.
*
* @param array $form
* An associative array containing the structure of the form.
* @param FormStateInterface $form_state
* An associative array containing the current state of the form.
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
// Empty implementation of the abstract submit class.
}
/**
* Define the form used for Inventory settings.
* @return array
* Form definition array.
*
* @param array $form
* An associative array containing the structure of the form.
* @param FormStateInterface $form_state
* An associative array containing the current state of the form.
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form['inventory_settings']['#markup'] = 'Settings form for Inventory. Manage field settings here.';
return $form;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment