🍰 Menu plugin for CakePHP
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
src
tests
webroot
.bettercodehub.yml
.codeclimate.yml
.editorconfig
.gitattributes
.gitignore
.stickler.yml
.travis.yml
LICENSE
README.md
composer.json
phpcs.xml.dist
phpstan.neon.dist
phpunit.xml.dist

README.md

Menu plugin for CakePHP

Build Status Latest Stable Version Total Downloads Latest Unstable Version License codecov BCH compliance

About

CakePHP 3+ plugin for managing application menus.

This plugin is developed by Qobo for Qobrix. It can be used as standalone CakePHP plugin, or as part of the project-template-cakephp installation.

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require qobo/menu

Usage

Basic usage example - in the view

$menu = new Menu();

// Create menu item link
$linkItem = new MenuItemLink();
$linkItem->setUrl('#');
$linkItem->setLabel(__('Edit'));
$linkItem->setIcon('pencil');
$linkItem->setOrder(100);
$menu->addMenuItem($linkItem);

$separatorItem = new MenuItemSeparator();
$menu->addMenuItem($separatorItem);

$postlinkItem = new MenuItemPostlink();
$postlinkItem->setUrl('#');
$postlinkItem->setLabel(__('Delete'));
$postlinkItem->setIcon('trash');
$postlinkItem->setConfirmMsg(__('Are you sure to delete it?'));
$postlinkItem->setOrder(130);

$menu->addMenuItem($postlinkItem);

$params = ['title' => 'Main Menu'];
$render = new MainMenuRenderAdminLte($menu, $this);
echo $render->render($params);

Supported menu items

MenuItemLink

MenuItemLinkButton

MenuItemLinkModal

MenuItemPostlink

MenuItemPostlinkButton

MenuItemButton

MenuItemCustom

MenuItemSeparator