KMP PHP API Reference

AppNavCell extends Cell
in package

App Navigation Cell

View Cell responsible for rendering the main application navigation bar. Handles complex navigation logic including user permissions, active states, responsive mobile navigation, and user menu functionality.

This cell is the primary navigation component for the KMP application, displaying different menu items based on user roles and permissions. The navigation structure is dynamically built based on the current user's access rights and the application's RBAC (Role-Based Access Control) system.

Template: templates/cell/AppNav/display.php

Tags
see
KmpHelper::appNav()

Helper method that invokes this cell

Table of Contents

Methods

display()  : void
Display the application navigation

Methods

display()

Display the application navigation

public display(array<string|int, mixed> $appNav, Member $user[, array<string|int, mixed> $navBarState = [] ]) : void

Sets up variables for the navigation template rendering. The template uses these variables to construct the Bootstrap navigation bar with dropdown menus, user profile access, and responsive mobile toggle.

The navigation structure includes:

  • Primary navigation items (Members, Branches, etc.)
  • User-specific menu with profile and settings
  • Administrative sections based on permissions
  • Mobile-responsive hamburger menu
Parameters
$appNav : array<string|int, mixed>

Navigation structure array containing menu hierarchy Format: [['label' => 'Menu Item', 'url' => '/path', 'children' => [...]]]

$user : Member

Current authenticated user entity Used for permission checks and user menu

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

Navigation bar state for highlighting active items Contains current controller/action for active state detection

Tags
example
// Called from KmpHelper in layout template
echo $this->cell('AppNav', [
    $navigationStructure,  // Built by controller
    $this->Identity->get(), // Current user
    ['controller' => 'Members', 'action' => 'index'] // For active states
]);
see

templates/cell/AppNav/display.php Template that renders the navigation

see
AppController::beforeRender()

Where navigation structure is built

Return values
void

Variables are set for template via $this->set()


        
On this page

Search results