CategoryTrailTrait
Table of Contents
Constants
- LIST_PAGE_SLUG : mixed = \App\Core\Routers\PageId::ESHOP_PRODUCT_LIST
- Fixed id of the front list page (`Front:Eshop ProductSet::list`); the same constant is used by {@see \App\UI\Front\Eshop\Components\ProductCategoryListComponent\ProductCategoryList}.
Methods
- buildCategoryTrail() : array<string|int, BreadcrumbItemDTO>
- Builds the trail of a category from the nested set (`lft`/`rgt`), root to current.
- buildCategoryUrl() : string|null
- Returns the list URL of a category.
Constants
LIST_PAGE_SLUG
Fixed id of the front list page (`Front:Eshop ProductSet::list`); the same constant is used by {@see \App\UI\Front\Eshop\Components\ProductCategoryListComponent\ProductCategoryList}.
private
mixed
LIST_PAGE_SLUG
= \App\Core\Routers\PageId::ESHOP_PRODUCT_LIST
Methods
buildCategoryTrail()
Builds the trail of a category from the nested set (`lft`/`rgt`), root to current.
protected
buildCategoryTrail(ProductCategory|null $currentCategory[, bool $intermediate = false ]) : array<string|int, BreadcrumbItemDTO>
Parameters
- $currentCategory : ProductCategory|null
- $intermediate : bool = false
Return values
array<string|int, BreadcrumbItemDTO>buildCategoryUrl()
Returns the list URL of a category.
protected
buildCategoryUrl(ProductCategory $category) : string|null
page and order are sent explicitly (the mask defaults 1 and 0, as in the sidebar
tree); without them Nette fails on the optional p-<page>o-<order> segment with
"Invalid link: Missing parameter". order = 0 is the "no sort chosen" sentinel, so the
link does not preselect a manual sort order.
Parameters
- $category : ProductCategory