You are here

public static function TwigTweakExtension::drupalMenu in Twig Tweak 3.1.x

Same name and namespace in other branches
  1. 3.x src/TwigTweakExtension.php \Drupal\twig_tweak\TwigTweakExtension::drupalMenu()

Returns the render array for Drupal menu.

File

src/TwigTweakExtension.php, line 207

Class

TwigTweakExtension
Twig extension with some useful functions and filters.

Namespace

Drupal\twig_tweak

Code

public static function drupalMenu(string $menu_name, int $level = 1, int $depth = 0, bool $expand = FALSE) : array {
  return \Drupal::service('twig_tweak.menu_view_builder')
    ->build($menu_name, $level, $depth, $expand);
}