You are here

public function ContextReactionFormBase::buildForm in Context 8

Same name and namespace in other branches
  1. 8.4 src/Reaction/ContextReactionFormBase.php \Drupal\context\Reaction\ContextReactionFormBase::buildForm()
  2. 8.0 src/Reaction/ContextReactionFormBase.php \Drupal\context\Reaction\ContextReactionFormBase::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

\Drupal\context\ContextInterface $context: The context that contains the reaction.

$reaction_id: The id of the reaction that is being configured.

Return value

array The form structure. The form structure.

Overrides FormInterface::buildForm

File

src/Reaction/ContextReactionFormBase.php, line 40

Class

ContextReactionFormBase

Namespace

Drupal\context\Reaction

Code

public function buildForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL, $reaction_id = NULL) {
  $this->context = $context;
  $this->reaction = $this->context
    ->getReaction($reaction_id);
  $form['reaction'] = [
    '#tree' => TRUE,
  ];
  $form['actions'] = [
    '#type' => 'actions',
  ];
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Save'),
    '#button_type' => 'primary',
  ];
  return $form;
}