Skip to content

Commit

Permalink
Merge pull request #5 from sardjn/main
Browse files Browse the repository at this point in the history
Changes for the new feature 'Additional URI'
  • Loading branch information
liviuk2 committed Aug 21, 2024
2 parents f7dbeca + 92806a1 commit abd7f98
Show file tree
Hide file tree
Showing 6 changed files with 751 additions and 511 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Rendering is based on `dmstr/yii2-adminlte-asset` menu widget.

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

> Note: Check the [composer.json](https://packagist.org/packages/esempla/yii2-rbac) for this extension's requirements and dependencies.
>__Note__ Check the [composer.json](https://packagist.org/packages/esempla/yii2-rbac) for this extension's requirements and dependencies.
Read this [web tip /wiki](https://packagist.org/packages/esempla/yii2-rbac) on setting the `minimum-stability` settings for your application's composer.json.

Either run
Expand Down Expand Up @@ -66,7 +66,31 @@ a string or an array of strings.

## Menus management

To access Dynamic Menu management, go to app route `/menu/dynamic-menu`
>__Note__ To access Dynamic Menu management, go to app route `/menu/dynamic-menu`.
> In that page there is a dedicated setup for configuring the sidebar menu.
These are the options you will see (Edit item):
* text | the label text of the menu option
* URL | the url that the menu option will redirect the page to
* additional URI | see description below
* target | HTML, specifies where will the URL be shown (check HTML docs)
* tooltip
* visibility condition | specified role (or roles) that can see the menu option

#### DESCRIPTION
If 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...),
you can do that, by adding more than one URL, using the additional URI text area.
_When adding multiple URI, it's important to note that there is no separator to distinguish them._
So the only rule used to distinguish them is by adding a different URI in a new line (don't add literally a `\n`!)
> For example:
> ```
> ┌──────────────────────────────┐
> additional URI: │ /controller/action │
> │ /default │
> └──────────────────────────────┘
> ```
> __Note__
> Remember **NOT** to put the `''` or the `""` for the URI and the URL!
### Item fields

Expand Down
6 changes: 6 additions & 0 deletions src/views/dynamic-menu/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@
<input type="text" class="form-control item-menu" id="href" name="href" placeholder="URL">
</div>
</div>
<div class="form-group">
<label for="href" class="col-sm-2 control-label">Additional URI</label>
<div class="col-sm-10">
<textarea type="text" class="form-control item-menu" id="additional_href" name="additional_href" placeholder="Additional URI"></textarea>
</div>
</div>
<div class="form-group">
<label for="target" class="col-sm-2 control-label">Target</label>
<div class="col-sm-10">
Expand Down
Loading

0 comments on commit abd7f98

Please sign in to comment.