Repository navigation
MenuEntry
Viames Marino edited this page Oct 19, 2026
·
2 revisions
Pair\Html\MenuEntry is the final value object used by Menu renderers.
Use it indirectly through Menu/BootstrapMenu. In most applications you do not instantiate it manually.
- Represents one node (label, URL, state, nesting metadata).
- Serves as stable render input for menu classes.
| Field | Default | Purpose |
|---|---|---|
type |
single |
Renderer branch: single, dropdown, separator, or title. |
title |
'' |
Visible label. |
url |
null |
Link URL. |
icon |
null |
Font Awesome icon class. |
badge |
null |
Optional badge text. |
badgeType |
primary |
Badge tone. |
target |
null |
Optional link target. |
active |
false |
Active navigation state. |
list |
[] |
Child MenuEntry objects for dropdown rendering. |
These fields are mutable presentation state. Menu creates and populates entries internally; it does not expose a public getEntries() accessor or an API for appending an existing entry object.
use Pair\Html\Menu;
$menu = new Menu();
$menu->item('dashboard/default', 'Dashboard', 'fa-house');
$menu->item('orders/default', 'Orders', 'fa-list');
echo $menu->render();use Pair\Html\BootstrapMenu;
$menu = new BootstrapMenu();
$menu->item('dashboard/default', 'Home', 'fa-house');
$menu->item('products/default', 'Products', 'fa-box');
echo $menu->render();- Persisting
MenuEntryas business data; it is a rendering object with public mutable fields. - Passing title and URL in reverse order.
item()takes the URL first and returnsvoid, so it cannot be chained.
See also: Menu, BootstrapMenu, Breadcrumb.
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4