You are here

function contextual_test_contextual_links_view_alter in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/contextual/tests/modules/contextual_test/contextual_test.module \contextual_test_contextual_links_view_alter()

Implements hook_contextual_links_view_alter().

@todo Apparently this too late to attach the library? It won't work without contextual_test_page_attachments_alter() Is that a problem? Should the contextual module itself do the attaching?

File

core/modules/contextual/tests/modules/contextual_test/contextual_test.module, line 26
Provides test contextual link on blocks.

Code

function contextual_test_contextual_links_view_alter(&$element, $items) {
  if (isset($element['#links']['contextual-test-ajax'])) {
    $element['#attached']['library'][] = 'core/drupal.dialog.ajax';
  }
}