You are here

public function EditableFieldsForm::ajaxCallback in Editable Fields 8

Same name and namespace in other branches
  1. 1.0.x src/Form/EditableFieldsForm.php \Drupal\editablefields\Form\EditableFieldsForm::ajaxCallback()

Editable field ajax callback.

Parameters

array $form: Form array.

\Drupal\Core\Form\FormStateInterface $form_state: Form state object.

Return value

array Updated form.

File

src/Form/EditableFieldsForm.php, line 159

Class

EditableFieldsForm
Class EditableFieldsForm.

Namespace

Drupal\editablefields\Form

Code

public function ajaxCallback(array &$form, FormStateInterface $form_state) {
  if (!$form_state
    ->getErrors()) {
    $form['confirm_message'] = [
      '#markup' => $this
        ->t('Updated'),
    ];
  }
  return $form;
}