stepapo/menu

Component for Nette Framework, that helps generate menus with links and action buttons.

Maintainers

Package info

github.com/stepapo/menu

Language:Latte

pkg:composer/stepapo/menu

Transparency log

Statistics

Installs: 309

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

1.0.1 2026-07-25 10:50 UTC

This package is auto-updated.

Last update: 2026-07-25 10:55:27 UTC


README

Component for Nette Framework, that helps generate menus with links and action buttons. The docs show basic example and explain ways of configurating menus.

Example

Let's create a menu with three links. Administration link is hidden for non-admins.

Definition

buttons:
    -
        label: Homepage
        destination: Home:default
    -
        label: About us
        destination: About:default
    -
        label: Administration
        destination: Admin:default
        hide: %hideAdmin%

Component

public function createComponentMainMenu(): MenuControl
{
    $menu = Menu::createFromNeon(__DIR__ . '/mainMenu.yml', [
        'hideAdmin' => !$this->user->isInRole('admin')
    ]);
    return new MenuControl($menu);
}

Template

{control mainMenu}

Configuration

Menu

buttons:
    - # include Button configuration
    - # include Button configuration
actions:
    - # include Button configuration
    - # include Button configuration
templateFile:
translator:

Button

label:
destination:
parameters:
selector:
icon:
type:
confimationText:
ajax:
history:
hide:
buttons:
    - # include Button configuration
    - # include Button configuration