You are here

public function MenuItemsTwigExtension::getFunctions in Simplify Menu 8

Same name and namespace in other branches
  1. 8.2 src/TwigExtension/MenuItemsTwigExtension.php \Drupal\simplify_menu\TwigExtension\MenuItemsTwigExtension::getFunctions()

File

src/TwigExtension/MenuItemsTwigExtension.php, line 34

Class

MenuItemsTwigExtension
Class MenuItemsTwigExtension.

Namespace

Drupal\simplify_menu\TwigExtension

Code

public function getFunctions() {
  return [
    new \Twig_SimpleFunction('simplify_menu', function ($menuId = NULL) {
      return $this->menuItems
        ->getMenuTree($menuId);
    }, [
      'is_safe' => [
        'html',
      ],
    ]),
  ];
}