function Callbacks::advancedCommandsAnnounceAssertiveCallback

Ajax form callback: Selects 'announce' with 'assertive' priority.

File

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

Class

Callbacks
Simple object for testing methods as Ajax callbacks.

Namespace

Drupal\ajax_forms_test

Code

public static function advancedCommandsAnnounceAssertiveCallback($form, FormStateInterface $form_state) : AjaxResponse {
    return (new AjaxResponse())->addCommand(new AnnounceCommand('Assertive announcement.', 'assertive'));
}

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