Search by

pieceofcake2 / acl_menu

ttsuru

CakePHP 2 component that builds navigation menus of the actions a user may access with ACL

Package info

github.com/pieceofcake2/acl_menu

Type:cakephp-plugin

pkg:composer/pieceofcake2/acl_menu

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.1 2026-10-16 08:35 UTC

README

GitHub License Packagist Version PHP CakePHP PHPStan CI Codecov

This is forked for CakePHP2.

A component for pieceofcake2/cakephp applications that builds a navigation menu of the controller actions the current user may access, checked with ACL (the same ACOs as ActionsAuthorize and the AclExtras plugin). The menu can be rendered with the MenuBuilder plugin.

Documentation

It covers the ACL requirements, rendering, the settings, $menuOptions, adding items, prefixes and plugins, caching and the migration from the CakePHP 1.3 version.

The Markdown documentation is also included in the Composer package, in the plugin's directory: plugins/AclMenu/docs/README.md (the location depends on your installer-paths).

Requirements

  • PHP 8.0+
  • pieceofcake2/cakephp 2.12+

Installation

composer require pieceofcake2/acl_menu

Load the plugin in config/bootstrap.php (legacy layout: app/Config/bootstrap.php):

CakePlugin::load('AclMenu');

See Installation for the installer-paths setting.

Usage

public $components = [
    'Acl',
    'Auth' => ['authorize' => ['Actions' => ['actionPath' => 'controllers']]],
    'AclMenu.Menu',
];

public $helpers = ['MenuBuilder.MenuBuilder'];
// templates/Layouts/default.ctp
echo $this->MenuBuilder->build();

The component sets the menu of the logged-in user to the view as $menu. See Usage.

Contributing

See the contribution guidelines.

Origin

This package is a maintained fork of markstory/cakephp_menu_component, the ACL menu component by Mark Story for CakePHP 1.3, ported to CakePHP 2. It is maintained for CakePHP 2 on modern PHP by pieceofcake2. Changes from the original are listed in the commit history since the fork.

License

Licensed under the MIT License. See LICENSE.