{"id":13684386,"url":"https://github.com/icings/menu","last_synced_at":"2026-01-11T14:01:45.346Z","repository":{"id":45341186,"uuid":"91030043","full_name":"icings/menu","owner":"icings","description":"A KnpMenu seasoned menu plugin for CakePHP.","archived":false,"fork":false,"pushed_at":"2024-06-19T08:41:41.000Z","size":218,"stargazers_count":12,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"5.x","last_synced_at":"2025-10-02T08:53:36.484Z","etag":null,"topics":["cakephp-plugin","knpmenu","menu","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-11T22:53:35.000Z","updated_at":"2025-02-25T22:39:33.000Z","dependencies_parsed_at":"2024-04-10T05:38:39.445Z","dependency_job_id":"4d329c6b-dd57-436c-bd6d-ad542365e83e","html_url":"https://github.com/icings/menu","commit_stats":{"total_commits":105,"total_committers":3,"mean_commits":35.0,"dds":"0.32380952380952377","last_synced_commit":"be6d42d13d3286c019cdf7b34d9b0967c8f7e6bf"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/icings/menu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icings%2Fmenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icings%2Fmenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icings%2Fmenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icings%2Fmenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icings","download_url":"https://codeload.github.com/icings/menu/tar.gz/refs/heads/5.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icings%2Fmenu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28306984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cakephp-plugin","knpmenu","menu","php"],"created_at":"2024-08-02T14:00:32.977Z","updated_at":"2026-01-11T14:01:45.233Z","avatar_url":"https://github.com/icings.png","language":"PHP","readme":"# Menu\n\n[![Build Status][ico-build]][link-build]\n[![Coverage Status][ico-coverage]][link-coverage]\n[![Latest Version][ico-version]][link-version]\n[![Software License][ico-license]][link-license]\n\n[ico-build]: https://img.shields.io/github/actions/workflow/status/icings/menu/ci.yml?branch=5.x\u0026style=flat-square\n[ico-coverage]: https://img.shields.io/codecov/c/github/icings/menu/5.x.svg?style=flat-square\n[ico-version]: https://img.shields.io/packagist/v/icings/menu.svg?style=flat-square\u0026label=latest\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n\n[link-build]: https://github.com/icings/menu/actions/workflows/ci.yml?query=branch%3A5.x\n[link-coverage]: https://codecov.io/github/icings/menu/tree/5.x\n[link-version]: https://packagist.org/packages/icings/menu\n[link-license]: LICENSE.txt\n\nA [KnpMenu](https://github.com/KnpLabs/KnpMenu) seasoned plugin that assists with creating menus for your\n[CakePHP](https://cakephp.org) applications.\n\n\n## Requirements\n\n* CakePHP 5.0+ (use the [4.x branch](https://github.com/icings/menu/tree/4.x) of this plugin if you need CakePHP 4\n  compatibility)\n* KnpMenu 3.3+\n\n\n## Installation\n\n1. Use [Composer](http://getcomposer.org) to add the menu plugin to your project:\n\n   ```bash\n   $ composer require icings/menu\n   ```\n\n2. Make sure that you are loading the plugin in your bootstrap, either run:\n\n   ```bash\n   $ bin/cake plugin load Icings/Menu\n   ```\n\n   or add the following call to your `Application` class' `bootstrap()` method in the `src/Application.php` file:\n\n   ```php\n   $this-\u003eaddPlugin('Icings/Menu');\n   ```\n\n3. Load the helper in your `AppView` class' `initialize()` method, located in the `src/View/AppView.php` file:\n\n   ```php\n   $this-\u003eloadHelper('Icings/Menu.Menu');\n   ```\n\n\n## Usage\n\nDetailed usage documentation can be found in the [docs](docs/index.md) folder. For those that are familiar with CakePHP\nand KnpMenu, here's two examples for a quick start.\n\n### Via the Menu helper\n\nBuild and render the menu via the helpers `create()` and `render()` methods:\n\n```php\n$menu = $this-\u003eMenu-\u003ecreate('main');\n$menu-\u003eaddChild('Home', ['uri' =\u003e ['controller' =\u003e 'Pages', 'action' =\u003e 'display', 'home']]);\n$menu-\u003eaddChild('About', ['uri' =\u003e ['controller' =\u003e 'Pages', 'action' =\u003e 'display', 'about']]);\n\n$menu-\u003eaddChild('Services', ['uri' =\u003e '#']);\n$menu['Services']-\u003eaddChild('Research', ['uri' =\u003e ['controller' =\u003e 'Pages', 'action' =\u003e 'display', 'research']]);\n$menu['Services']-\u003eaddChild('Security', ['uri' =\u003e ['controller' =\u003e 'Pages', 'action' =\u003e 'display', 'security']]);\n\n$menu-\u003eaddChild('Contact', ['uri' =\u003e ['controller' =\u003e 'Pages', 'action' =\u003e 'display', 'contact']]);\n\necho $this-\u003eMenu-\u003erender();\n```\n\nIn the default setup, this would generate the following HTML:\n\n```html\n\u003cul\u003e\n    \u003cli\u003e\n        \u003ca href=\"/pages/display/home\"\u003eHome\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n        \u003ca href=\"/pages/display/about\"\u003eAbout\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli class=\"has-dropdown\"\u003e\n        \u003ca href=\"#\"\u003eServices\u003c/a\u003e\n        \u003cul class=\"dropdown\"\u003e\n            \u003cli\u003e\n                \u003ca href=\"/pages/display/research\"\u003eResearch\u003c/a\u003e\n            \u003c/li\u003e\n            \u003cli\u003e\n                \u003ca href=\"/pages/display/security\"\u003eSecurity\u003c/a\u003e\n            \u003c/li\u003e\n        \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n        \u003ca href=\"/pages/display/contact\"\u003eContact\u003c/a\u003e\n    \u003c/li\u003e\n\u003c/ul\u003e\n```\n\n### Using the library directly\n\nAside from using the menu helper and its various configuration possibilities, it's also possible to manually utilize\nthe library provided by this plugin, optionally combining things with the KnpMenu library:\n\n```php\nuse Icings\\Menu\\Integration\\PerItemVotersExtension;\nuse Icings\\Menu\\Integration\\RoutingExtension;\nuse Icings\\Menu\\Integration\\TemplaterExtension;\nuse Icings\\Menu\\Matcher\\Matcher;\nuse Icings\\Menu\\Matcher\\Voter\\UrlVoter;\nuse Icings\\Menu\\MenuFactory;\nuse Icings\\Menu\\Renderer\\StringTemplateRenderer;\n\n$factory = new MenuFactory();\n$factory-\u003eaddExtension(new RoutingExtension());\n$factory-\u003eaddExtension(new PerItemVotersExtension());\n$factory-\u003eaddExtension(new TemplaterExtension());\n\n$menu = $factory-\u003ecreateItem('main');\n$menu-\u003eaddChild('Home', ['uri' =\u003e ['controller' =\u003e 'Pages', 'action' =\u003e 'display', 'home']]);\n$menu-\u003eaddChild('About', ['uri' =\u003e ['controller' =\u003e 'Pages', 'action' =\u003e 'display', 'about']]);\n$menu-\u003eaddChild('Services', ['uri' =\u003e '#']);\n$menu['Services']-\u003eaddChild('Research', ['uri' =\u003e ['controller' =\u003e 'Pages', 'action' =\u003e 'display', 'research']]);\n$menu['Services']-\u003eaddChild('Security', ['uri' =\u003e ['controller' =\u003e 'Pages', 'action' =\u003e 'display', 'security']]);\n$menu-\u003eaddChild('Contact', ['uri' =\u003e ['controller' =\u003e 'Pages', 'action' =\u003e 'display', 'contact']]);\n\n$matcher = new Matcher();\n$matcher-\u003eaddVoter(new UrlVoter($this-\u003erequest));\n\n$renderer = new StringTemplateRenderer($matcher);\necho $renderer-\u003erender($menu);\n```\n\n\n## Issues\n\nPlease use the [issue tracker](https://github.com/icings/menu/issues) to report problems.","funding_links":[],"categories":["Navigation"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficings%2Fmenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficings%2Fmenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficings%2Fmenu/lists"}