You are here

function menu_firstchild_menu_link_content_form_ajax_callback in Menu Firstchild 2.x

Same name and namespace in other branches
  1. 8 menu_firstchild.module \menu_firstchild_menu_link_content_form_ajax_callback()

AJAX callback.

Parameters

array $form: Form array.

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

Return value

\Drupal\Core\Ajax\AjaxResponse AJAX callback response.

1 string reference to 'menu_firstchild_menu_link_content_form_ajax_callback'
menu_firstchild_form_menu_link_content_form_alter in ./menu_firstchild.module
Implements hook_form_BASE_FORM_ID_alter().

File

./menu_firstchild.module, line 83
Contains menu_firstchild.module.

Code

function menu_firstchild_menu_link_content_form_ajax_callback(array &$form, FormStateInterface $form_state) {
  $replace_link = new HtmlCommand('#menu-firstchild-link-wrapper', $form['link']);
  $response = new AjaxResponse();
  $response
    ->addCommand($replace_link);
  return $response;
}