function ContextualTestHooks::contextualLinksViewAlter

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/src/Hook/ContextualTestHooks.php, line 30

Class

ContextualTestHooks
Hook implementations for contextual_test.

Namespace

Drupal\contextual_test\Hook

Code

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

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