W3cubDocs

/Drupal 8

class ActiveLinkResponseFilter

Subscribes to filter HTML responses, to set the 'is-active' class on links.

Only for anonymous users; for authenticated users, the active-link asset library is loaded.

Hierarchy

See also

system_page_attachments()

File

core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php, line 23

Namespace

Drupal\Core\EventSubscriber

Members

Name Modifiers Type Description
ActiveLinkResponseFilter::$currentPath protected property The current path.
ActiveLinkResponseFilter::$currentUser protected property The current user.
ActiveLinkResponseFilter::$languageManager protected property The language manager.
ActiveLinkResponseFilter::$pathMatcher protected property The path matcher.
ActiveLinkResponseFilter::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. Overrides EventSubscriberInterface::getSubscribedEvents
ActiveLinkResponseFilter::onResponse public function Sets the 'is-active' class on links.
ActiveLinkResponseFilter::setLinkActiveClass public static function Sets the "is-active" class on relevant links.
ActiveLinkResponseFilter::__construct public function Constructs a new ActiveLinkResponseFilter instance.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!EventSubscriber!ActiveLinkResponseFilter.php/class/ActiveLinkResponseFilter/8.1.x