function ajax_forms_test_advanced_commands_add_css_legacy_callback
Ajax callback for 'add_css' that uses legacy string parameter.
@todo Remove in Drupal 11.0.0 https://www.drupal.org/i/3339374
1 string reference to 'ajax_forms_test_advanced_commands_add_css_legacy_callback'
- AjaxFormsTestCommandsForm::buildForm in core/
modules/ system/ tests/ modules/ ajax_forms_test/ src/ Form/ AjaxFormsTestCommandsForm.php - .
File
-
core/
modules/ system/ tests/ modules/ ajax_forms_test/ ajax_forms_test.module, line 223
Code
function ajax_forms_test_advanced_commands_add_css_legacy_callback($form, FormStateInterface $form_state) {
$response = new AjaxResponse();
$response->addCommand(new AddCssCommand("<link rel='stylesheet' href='my/file.css' media='all' />"));
return $response;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.