function Callbacks::advancedCommandsDataCallback
Ajax form callback: Selects 'data'.
File
-
core/
modules/ system/ tests/ modules/ ajax_forms_test/ src/ Callbacks.php, line 192
Class
- Callbacks
- Simple object for testing methods as Ajax callbacks.
Namespace
Drupal\ajax_forms_testCode
public static function advancedCommandsDataCallback($form, FormStateInterface $form_state) : AjaxResponse {
$selector = '#data_div';
$response = new AjaxResponse();
$response->addCommand(new DataCommand($selector, 'test_key', 'test_value'));
return $response;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.