Skip to content
Snippets Groups Projects
Commit bf5ee20f authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2493697 by cilefen, JeroenT: remove deprecated getUrlFromPath method from TwigExtension

parent 2ea19c71
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,6 @@ public function getFunctions() {
// in \Symfony\Bridge\Twig\Extension\RoutingExtension
new \Twig_SimpleFunction('url', array($this, 'getUrl'), array('is_safe_callback' => array($this, 'isUrlGenerationSafe'))),
new \Twig_SimpleFunction('path', array($this, 'getPath'), array('is_safe_callback' => array($this, 'isUrlGenerationSafe'))),
new \Twig_SimpleFunction('url_from_path', array($this, 'getUrlFromPath'), array('is_safe_callback' => array($this, 'isUrlGenerationSafe'))),
new \Twig_SimpleFunction('link', array($this, 'getLink')),
new \Twig_SimpleFunction('file_url', 'file_create_url'),
new \Twig_SimpleFunction('attach_library', [$this, 'attachLibrary']),
......@@ -229,31 +228,6 @@ public function getUrl($name, $parameters = array(), $options = array()) {
return $build;
}
/**
* Generates an absolute URL given a path.
*
* @param string $path
* The path.
* @param array $options
* (optional) An associative array of additional options. The 'absolute'
* option is forced to be TRUE.
*
* @return string
* The generated absolute URL for the given path.
*
* @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 8.0.0.
*/
public function getUrlFromPath($path, $options = array()) {
// Generate URL.
$options['absolute'] = TRUE;
$generated_url = $this->urlGenerator->generateFromPath($path, $options, TRUE);
// Return as render array, so we can bubble the bubbleable metadata.
$build = ['#markup' => $generated_url->getGeneratedUrl()];
$generated_url->applyTo($build);
return $build;
}
/**
* Gets a rendered link from an url object.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment