pieceofcake2 / acl_menu
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
Requires
- php: >=8.0
- composer/installers: ^1.0 || ^2.0
- pieceofcake2/cakephp: ^2.12
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.6
- pieceofcake2/app: ^2.2
- pieceofcake2/phpcs-cakephp2: ^1.1
- pieceofcake2/phpstan-cakephp2: ^1.0
Suggests
- pieceofcake2/acl_extras: Creates the ACO nodes of all controllers and actions
- pieceofcake2/menu_builder: Renders the menu
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-16 09:32:59 UTC
README
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
- Website: https://pieceofcake2.github.io/acl_menu/ (日本語: https://pieceofcake2.github.io/acl_menu/ja/)
- Markdown: docs/README.md (日本語: docs/ja/README.md) (for AI tools and offline reading)
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.