function Callbacks::advancedCommandsSettingsCallback

Ajax form callback: Selects 'settings'.

File

core/modules/system/tests/modules/ajax_forms_test/src/Callbacks.php, line 256

Class

Callbacks
Simple object for testing methods as Ajax callbacks.

Namespace

Drupal\ajax_forms_test

Code

public static function advancedCommandsSettingsCallback($form, FormStateInterface $form_state) : AjaxResponse {
    $setting['ajax_forms_test']['foo'] = 42;
    $response = new AjaxResponse();
    $response->addCommand(new SettingsCommand($setting));
    return $response;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.