breadcrumb.php
Table of Contents
Constants
- BREADCRUMB_ALIASES = ['Home' => "Domů", 'Event' => "Událost", 'Admin' => "Admin", 'Admin-users' => "Uživetelé", 'Admin-events' => "Události", 'Admin-users-update' => "Úprava", 'Admin-events-update' => "Událost"]
- Configuration constant mapping breadcrumb keys to their display labels.
- BREADCRUMB_MAP = ['Home' => \createLink("/index.php"), 'Event' => \createLink("/event.php"), 'Admin' => \createLink("/admin/index.php"), 'Admin-users' => \createLink("/admin/users.php"), 'Admin-events' => \createLink("/admin/events.php"), 'Admin-users-update' => \createLink("/admin/user.php"), 'Admin-events-update' => \createLink("/admin/events/update.php")]
- Configuration constant mapping breadcrumb keys to their corresponding URLs.
Functions
- generateBreadcrumbs() : string
- Generates the HTML for the breadcrumb navigation based on a list of keys.
Constants
BREADCRUMB_ALIASES
Configuration constant mapping breadcrumb keys to their display labels.
public
mixed
BREADCRUMB_ALIASES
= ['Home' => "Domů", 'Event' => "Událost", 'Admin' => "Admin", 'Admin-users' => "Uživetelé", 'Admin-events' => "Události", 'Admin-users-update' => "Úprava", 'Admin-events-update' => "Událost"]
This array defines the human-readable text shown in the navigation UI. Key: The unique identifier for the page (matching BREADCRUMB_MAP). Value: The localized (Czech) label string.
BREADCRUMB_MAP
Configuration constant mapping breadcrumb keys to their corresponding URLs.
public
mixed
BREADCRUMB_MAP
= ['Home' => \createLink("/index.php"), 'Event' => \createLink("/event.php"), 'Admin' => \createLink("/admin/index.php"), 'Admin-users' => \createLink("/admin/users.php"), 'Admin-events' => \createLink("/admin/events.php"), 'Admin-users-update' => \createLink("/admin/user.php"), 'Admin-events-update' => \createLink("/admin/events/update.php")]
This array defines the navigation paths for the breadcrumb system. Key: The unique identifier for the page. Value: The absolute URL path generated by the createLink function.
Functions
generateBreadcrumbs()
Generates the HTML for the breadcrumb navigation based on a list of keys.
generateBreadcrumbs(array<string|int, string> $items) : string
This function takes an array of location keys, verifies them against the global configuration maps, and constructs an HTML unordered list. The final item in the list is rendered as plain text (indicating the current page), while all preceding items are rendered as clickable links.
Parameters
- $items : array<string|int, string>
-
An ordered array of breadcrumb keys (e.g., ['Home', 'Admin']).
Return values
string —The generated HTML markup for the breadcrumb navigation.