throw new \
LogicException('Only #attached and #cache may be set in hook_page_attachments().'
);
} // Modules and themes can alter page attachments.
$this->moduleHandler->
alter('page_attachments',
$attachments);
$this->themeManager->
alter('page_attachments',
$attachments);
if (array_diff(array_keys($attachments),
['#attached', '#cache'
]) !==
[]) { throw new \
LogicException('Only #attached and #cache may be set in hook_page_attachments_alter().'
);
} // Merge the attachments onto the $page render array.
$page =
$this->renderer->
mergeBubbleableMetadata($page,
$attachments);
} /**
* Invokes the page top and bottom hooks.
*
* @param array &$html
* A #type 'html' render array, for which the page top and bottom hooks will
* be invoked, and to which the 'page_top' and 'page_bottom' children (also
* render arrays) will be added (if non-empty).
*
* @throws \LogicException
*
* @internal
*
* @see hook_page_top()
* @see hook_page_bottom()
* @see html.html.twig
*/