// For authenticated users, the 'is-active' class is set in JavaScript.
// @see system_page_attachments()
if ($this->currentUser->
isAuthenticated()) { return;
} // If content is FALSE, assume the response does not support the
// setContent() method and skip it, for example,
// \Symfony\Component\HttpFoundation\BinaryFileResponse.
$content =
$response->
getContent();
if ($content !== FALSE
) { $response->
setContent(static::
setLinkActiveClass( $content,
ltrim($this->currentPath->
getPath(), '/'
),
$this->pathMatcher->
isFrontPage(),
$this->languageManager->
getCurrentLanguage(LanguageInterface::TYPE_URL
) ->
getId(),
$event->
getRequest()->query->
all() ));
} } /**
* Sets the "is-active" class on relevant links.
*
* This is a PHP implementation of the drupal.active-link JavaScript library.
*
* @param string $html_markup
* The HTML markup to update.
* @param string $current_path
* The system path of the currently active page.
* @param bool $is_front
* Whether the current page is the front page (which implies the current
* path might also be <front>).
* @param string $url_language
* The language code of the current URL.
* @param array $query
* The query string for the current URL.
*
* @return string
* The updated HTML markup.
*
* @todo Once a future version of PHP supports parsing HTML5 properly
* (i.e. doesn't fail on
* https://www.drupal.org/comment/7938201#comment-7938201) then we can get
* rid of this manual parsing and use DOMDocument instead.
*/