if (!
empty($variables['options'
]['set_active_class'
]) && !
$url->
isExternal()) { // Add a "data-drupal-link-query" attribute to let the
// drupal.active-link library know the query in a standardized manner.
if (!
empty($variables['options'
]['query'
])) { $query =
$variables['options'
]['query'
];
ksort($query);
$variables['options'
]['attributes'
]['data-drupal-link-query'
] = Json::
encode($query);
} // Add a "data-drupal-link-system-path" attribute to let the
// drupal.active-link library know the path in a standardized manner.
if ($url->
isRouted() && !
isset($variables['options'
]['attributes'
]['data-drupal-link-system-path'
])) { // @todo System path is deprecated - use the route name and parameters.
$system_path =
$url->
getInternalPath();
// Special case for the front page.
if ($url->
getRouteName() === '<front>'
) { $system_path = '<front>';
} if (!
empty($system_path)) { $variables['options'
]['attributes'
]['data-drupal-link-system-path'
] =
$system_path;
} }