template_preprocess_breadcrumb

template_preprocess_breadcrumb(&$variables)

Prepares variables for breadcrumb templates.

Default template: breadcrumb.html.twig.

Parameters

array $variables: An associative array containing:

File

core/includes/theme.inc, line 1693
The theme system, which controls the output of Drupal.

Code

function template_preprocess_breadcrumb(&$variables) {
  $variables['breadcrumb'] = array();
  /** @var \Drupal\Core\Link $link */
  foreach ($variables['links'] as $key => $link) {
    $variables['breadcrumb'][$key] = array('text' => $link->getText(), 'url' => $link->getUrl()->toString());
  }
}
doc_Drupal
2016-10-29 09:46:38
Comments
Leave a Comment

Please login to continue.