class StaticPageCategoryExtension extends Twig_Extension

Class StaticPageCategoryExtension is injected as twig.extension.static.page.category service. StaticPageCategoryExtension handles the logic and provides necessary data for managed entity in twig.

Methods

__construct(StaticPageCategoryManager $categoryManager)

StaticPageCategoryExtension constructor.

getFunctions()

{@inheritdoc}

mixed
getTreeCategories(string $locale)

Get cached tree content for Static Page Categories

setTreeCategoriesToCache(string $locale)

Set generated tree to cache

mixed
getCategoriesForMegamenu(string $theme, string $locale)

Get cached megamenu content

array|mixed
getChildrenInOrder(StaticPageCategory $category)

Get category children

string
getName()

Returns the name of the extension.

Details

at line 33
__construct(StaticPageCategoryManager $categoryManager)

StaticPageCategoryExtension constructor.

Parameters

StaticPageCategoryManager $categoryManager

at line 41
getFunctions()

{@inheritdoc}

at line 56
mixed getTreeCategories(string $locale)

Get cached tree content for Static Page Categories

Parameters

string $locale

Return Value

mixed

at line 71
setTreeCategoriesToCache(string $locale)

Set generated tree to cache

Parameters

string $locale

at line 85
mixed getCategoriesForMegamenu(string $theme, string $locale)

Get cached megamenu content

Parameters

string $theme
string $locale

Return Value

mixed

at line 96
array|mixed getChildrenInOrder(StaticPageCategory $category)

Get category children

Parameters

StaticPageCategory $category

Return Value

array|mixed

at line 110
string getName()

Returns the name of the extension.

Return Value

string The extension name