diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php index 04fac02..6c93162 100644 --- a/core/lib/Drupal.php +++ b/core/lib/Drupal.php @@ -381,6 +381,17 @@ public static function urlGenerator() { } /** + * Returns a URL for a given route, parameters, and options. + * + * @see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() + * + * @return string + */ + public static function url($route_name, $rotue_parameters = array(), $options = array()) { + return static::$container->get('url_generator')->generateFromRoute($route_name, $route_parameters, $options); + } + + /** * Returns the link generator service. * * @return \Drupal\Core\Utility\LinkGeneratorInterface @@ -390,6 +401,17 @@ public static function linkGenerator() { } /** + * Returns a link for a given route, parameters, and options. + * + * @see \Drupal\Core\Utility\LinkGeneratorInterface::generate() + * + * @return string + */ + public static function l($text, $route_name, $rotue_parameters = array(), $options = array()) { + return static::$container->get('link_generator')->generate($text, $route_name, $route_parameters, $options); + } + + /** * Returns the string translation service. * * @return \Drupal\Core\StringTranslation\TranslationManager