{"id":21342983,"url":"https://github.com/yetopen/yii2-dynamic-menu","last_synced_at":"2026-03-06T19:36:56.031Z","repository":{"id":149339715,"uuid":"546572277","full_name":"YetOpen/yii2-dynamic-menu","owner":"YetOpen","description":"Fork of https://git.esempla.systems/free/packagist/yii2-dynamic-menu","archived":false,"fork":false,"pushed_at":"2024-08-21T09:11:29.000Z","size":117,"stargazers_count":0,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T06:11:17.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YetOpen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-10-06T09:41:29.000Z","updated_at":"2024-08-21T09:10:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"6ac54f53-24fc-41cf-83d3-21db33b00e77","html_url":"https://github.com/YetOpen/yii2-dynamic-menu","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/YetOpen/yii2-dynamic-menu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YetOpen%2Fyii2-dynamic-menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YetOpen%2Fyii2-dynamic-menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YetOpen%2Fyii2-dynamic-menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YetOpen%2Fyii2-dynamic-menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YetOpen","download_url":"https://codeload.github.com/YetOpen/yii2-dynamic-menu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YetOpen%2Fyii2-dynamic-menu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30193652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-11-22T01:11:32.395Z","updated_at":"2026-03-06T19:36:56.013Z","avatar_url":"https://github.com/YetOpen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamically configurable menu\n\nThis extension allow you to generate menus from backend, and load them dynamically according to user roles.\n\nRendering is based on `dmstr/yii2-adminlte-asset` menu widget.\n\n## Installation\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\n\u003e__Note__ Check the [composer.json](https://packagist.org/packages/esempla/yii2-rbac) for this extension's requirements and dependencies.\nRead this [web tip /wiki](https://packagist.org/packages/esempla/yii2-rbac) on setting the `minimum-stability` settings for your application's composer.json.\n\nEither run\n\n```bash\nphp composer.phar require esempla/yii2-dynamic-menu \"1.0.*\"\n```\n\nor add\n\n```bash\n\"esempla/yii2-dynamic-menu\": \"1.0.*\"\n```\n\nto the `require` section of your `composer.json` file.\n\n## Migrations\n\nThe extension has been created with database table. You should execute database migrations.(*PostgreSQL \u0026reg;* recommended)\n\n```php\nphp yii migrate/up --migrationPath=vendor/esempla/yii2-dynamic-menu/src/migrations\n```\n\n## Module\n\nThe extension has been created as a module. You should configure the module with a name of `authManager` as shown below:\n\n```php\n'modules' =\u003e [\n ...\n 'menu' =\u003e [\n        'class' =\u003e 'esempla\\dynamicmenu\\DynamicMenu',\n    ],\n ...\n],\n```\n\n###  Configuration options\n\n* `skipDuplicateHref` (default: true): if enabled, when merging multiple menus, the loader will skip items with duplicate HREF.\nThis requires every item, even expandable ones, to have a different href (not empty). To retain empty items, they should have a unique \"#anchor\" link;\n\n## Usage\n\nAdd to your layouts view\n\n```php\n\u003c?php echo \\esempla\\dynamicmenu\\widgets\\DynamicMenuWidget::widget(); ?\u003e\n```\n\nBy default, the widget will search for all user assigned roles and display the menu items matching the search.\nIt can be forced to load one or more roles, despite the user's ones, by passing the `roles` parameter. The parameter accepts either\na string or an array of strings.\n\n## Menus management\n\n\u003e__Note__ To access Dynamic Menu management, go to app route `/menu/dynamic-menu`.\n\u003e In that page there is a dedicated setup for configuring the sidebar menu. \n\nThese are the options you will see (Edit item):\n* text | the label text of the menu option\n* URL | the url that the menu option will redirect the page to\n* additional URI | see description below\n* target | HTML, specifies where will the URL be shown (check HTML docs)\n* tooltip\n* visibility condition | specified role (or roles) that can see the menu option\n\n#### DESCRIPTION\nIf you want to add more than one URI (let's say that in your action you rendere a different view based on a specific action, eg: based on the current date, role of the user, permissions, etc...),\nyou can do that, by adding more than one URL, using the additional URI text area.\n_When adding multiple URI, it's important to note that there is no separator to distinguish them._\nSo the only rule used to distinguish them is by adding a different URI in a new line (don't add literally a `\\n`!)\n\u003e For example:\n\u003e ```\n\u003e                 ┌──────────────────────────────┐\n\u003e additional URI: │ /controller/action           │\n\u003e                 │ /default                     │\n\u003e                 └──────────────────────────────┘\n\u003e ```\n\u003e __Note__\n\u003e Remember **NOT** to put the `''` or the `\"\"` for the URI and the URL!\n\n### Item fields\n\nFor each menu item, the \"classic\" elements can be declared:\n\n* Text: the text to display, with optional Font-Awesome icon\n* URL: it can either be a direct url, or a route array in the form of a string. In both cases, the string is passed to `Url::toRoute()` for processing\n* Target: html href target\n* Tooltip: optional link tooltip\n* Visibility condition: item visibility condition (optional). The string will be split either by `|` or `\u0026`, and found tokens (permissions) will be passed to\n`Yii::$app-\u003euser-\u003ecan()`, and concatenated with the declared logical operator. No nested condition or parenthesis are accepted. Permissions can be prefixed\nby `!` for negative test. Some special cases strings are managed: `ISGUEST` will be translated to `Yii::$app-\u003euser-\u003eisGuest`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyetopen%2Fyii2-dynamic-menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyetopen%2Fyii2-dynamic-menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyetopen%2Fyii2-dynamic-menu/lists"}