|
|
@ -46,6 +46,7 @@ class TwigExtension extends \Twig_Extension { |
|
|
|
new \Twig_SimpleFunction('drupal_url', [$this, 'drupalUrl']), |
|
|
|
new \Twig_SimpleFunction('drupal_url', [$this, 'drupalUrl']), |
|
|
|
new \Twig_SimpleFunction('drupal_link', [$this, 'drupalLink']), |
|
|
|
new \Twig_SimpleFunction('drupal_link', [$this, 'drupalLink']), |
|
|
|
new \Twig_SimpleFunction('drupal_messages', [$this, 'drupalMessages']), |
|
|
|
new \Twig_SimpleFunction('drupal_messages', [$this, 'drupalMessages']), |
|
|
|
|
|
|
|
new \Twig_SimpleFunction('drupal_breadcrumb', [$this, 'drupalBreadcrumb']), |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -515,6 +516,15 @@ class TwigExtension extends \Twig_Extension { |
|
|
|
return ['#type' => 'status_messages']; |
|
|
|
return ['#type' => 'status_messages']; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Builds the breadcrumb. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function drupalBreadcrumb() { |
|
|
|
|
|
|
|
return \Drupal::service('breadcrumb') |
|
|
|
|
|
|
|
->build(\Drupal::routeMatch()) |
|
|
|
|
|
|
|
->toRenderable(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Replaces all tokens in a given string with appropriate values. |
|
|
|
* Replaces all tokens in a given string with appropriate values. |
|
|
|
* |
|
|
|
* |
|
|
|