KMP PHP API Reference

WaiversNavigationProvider
in package

Waivers Navigation Provider

Provides navigation menu items for the Waivers plugin. Integrates with KMP's NavigationRegistry for dynamic menu generation.

Tags
see

/docs/5.7-waivers-plugin.md

Table of Contents

Methods

getBranchNavigationItems()  : array<string|int, mixed>
Get navigation items for branch context
getMemberNavigationItems()  : array<string|int, mixed>
Get navigation items for member context
getNavigationItems()  : array<string|int, mixed>
Get Navigation Items
getUnreadCount()  : int
Example helper: Get unread count for notification badge

Methods

getBranchNavigationItems()

Get navigation items for branch context

public static getBranchNavigationItems(mixed $user, int $branchId[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>

Returns navigation items specific to a branch page. These items appear in branch-specific navigation areas.

Parameters
$user : mixed

The current user identity

$branchId : int

The branch being viewed

$params : array<string|int, mixed> = []

Additional parameters

Return values
array<string|int, mixed>

Array of navigation items

getMemberNavigationItems()

Get navigation items for member context

public static getMemberNavigationItems(mixed $user, int $memberId[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>

Returns navigation items specific to a member's profile page. These items appear in member-specific navigation areas.

Parameters
$user : mixed

The current user identity

$memberId : int

The member being viewed

$params : array<string|int, mixed> = []

Additional parameters

Return values
array<string|int, mixed>

Array of navigation items

getNavigationItems()

Get Navigation Items

public static getNavigationItems(mixed $user[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>

Returns an array of navigation items for the Waivers plugin. This method is called by the NavigationRegistry when building the application menu.

Navigation items use the KMP navigation format with:

  • type: "link" for navigation links
  • mergePath: Hierarchical path array for menu organization
  • label: Display text
  • order: Sort order within the mergePath
  • url: CakePHP URL array
  • icon: Bootstrap icon class
  • badgeValue: Optional dynamic badge configuration
  • activePaths: Optional array of paths that highlight this nav item
Parameters
$user : mixed

The current user identity (null if not logged in)

$params : array<string|int, mixed> = []

Request parameters and context

Return values
array<string|int, mixed>

Array of navigation items in KMP format

getUnreadCount()

Example helper: Get unread count for notification badge

protected static getUnreadCount(mixed $user) : int
Parameters
$user : mixed

The current user identity

Return values
int

Number of unread items


        
On this page

Search results