class MenuBuilderExtension extends Twig_Extension

Class MenuBuilderExtension is injected as empire_menu_builder_extension service. MenuBuilderExtension handles the logic and provides necessary data for managed entity in twig.

Properties

protected MenuItemManager $manager
protected ArrayCollection $relationshipNames

Methods

__construct(MenuItemManager $manager)

MenuBuilderExtension constructor.

getFunctions()

{@inheritdoc}

array
getFirstLevelMenuItems(string $locale)

Find all menu items that match provided locale

string
getTreeMenu(bool $useFromCache, string $locale)

Retrieve cached menu tree html. Set to cache if it is missing

string
getResponsiveTreeMenu(bool $useFromCache, string $locale)

No description

mixed
getRouteForNode(MenuItem $node, string $locale)

No description

setResponsiveMenuTreeToCache(string|null $locale = null, bool $useFromCache = true)

Set to cache responsive menu tree html

setMenuTreeToCache(string|null $locale = null, bool $useFromCache = true)

Set to cache menu tree html

string
getName()

Returns the name of the extension.

Details

at line 51
__construct(MenuItemManager $manager)

MenuBuilderExtension constructor.

Parameters

MenuItemManager $manager

at line 59
getFunctions()

{@inheritdoc}

at line 76
array getFirstLevelMenuItems(string $locale)

Find all menu items that match provided locale

Parameters

string $locale

Return Value

array

at line 89
string getTreeMenu(bool $useFromCache, string $locale)

Retrieve cached menu tree html. Set to cache if it is missing

Parameters

bool $useFromCache
string $locale

Return Value

string

at line 104
string getResponsiveTreeMenu(bool $useFromCache, string $locale)

Parameters

bool $useFromCache
string $locale

Return Value

string

at line 119
mixed getRouteForNode(MenuItem $node, string $locale)

Parameters

MenuItem $node
string $locale

Return Value

mixed

at line 131
setResponsiveMenuTreeToCache(string|null $locale = null, bool $useFromCache = true)

Set to cache responsive menu tree html

Parameters

string|null $locale
bool $useFromCache

at line 239
setMenuTreeToCache(string|null $locale = null, bool $useFromCache = true)

Set to cache menu tree html

Parameters

string|null $locale
bool $useFromCache

at line 315
string getName()

Returns the name of the extension.

Return Value

string The extension name