8.5.x book_test.module book_test_page_attachments(array &$page)
8.0.x book_test.module book_test_page_attachments(array &$page)
8.1.x book_test.module book_test_page_attachments(array &$page)
8.2.x book_test.module book_test_page_attachments(array &$page)
8.3.x book_test.module book_test_page_attachments(array &$page)
8.4.x book_test.module book_test_page_attachments(array &$page)
8.6.x book_test.module book_test_page_attachments(array &$page)

Implements hook_page_attachments().

File

core/modules/book/tests/modules/book_test/book_test.module, line 17
Test module for testing the book module.

Code

function book_test_page_attachments(array &$page) {
  $page['#cache']['tags'][] = 'book_test.debug_book_navigation_cache_context';
  if (\Drupal::state()
    ->get('book_test.debug_book_navigation_cache_context', FALSE)) {
    drupal_set_message(\Drupal::service('cache_contexts_manager')
      ->convertTokensToKeys([
      'route.book_navigation',
    ])
      ->getKeys()[0]);
  }
}