Skip to content

Menu::make method and public getItems for faster prototyping menus and micro menus rendering. - #109

Open
n3storm wants to merge 10 commits into
rinvex:masterfrom
n3storm:master
Open

Menu::make method and public getItems for faster prototyping menus and micro menus rendering.#109
n3storm wants to merge 10 commits into
rinvex:masterfrom
n3storm:master

Conversation

@n3storm

@n3storm n3storm commented Sep 1, 2023

Copy link
Copy Markdown

Rinvex Menus features are solid: multiple menus, item attributes and properties, nesting and dropdowns, and presenters.

People gets very creative about menus.

In our case we are prototyping menus for a new app and coding presentables is not the right moment yet.
We are using tabler, a derivative from bootstrap 5 with some twists so we cannot use default ones even if blade templates were made for BS5. They are currently made for BS4.
Apart from that we are using TwigBridge.

With this pull developers can make:

$menu = \Menu::make('modules');

foreach ($menu.getItems() as $item) {
    ...iterate item.properties.title ...
}

Separate render operation in two methods: make and render
Allow public getter to be able to iterate items outside a presentable (using Menu::make)
* @return MenuGenerator|null
*/
public function render(string $name, string $presenter = null, array $bindings = [], bool $specialSidebar = false): ?string
public function make(string $name, string $presenter = null, array $bindings = [], bool $specialSidebar = false): ?MenuGenerator

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid unused parameters such as '$presenter'.

* @return MenuGenerator|null
*/
public function render(string $name, string $presenter = null, array $bindings = [], bool $specialSidebar = false): ?string
public function make(string $name, string $presenter = null, array $bindings = [], bool $specialSidebar = false): ?MenuGenerator

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid unused parameters such as '$specialSidebar'.

StyleCI fixes
code coverage fixes
codestyle fixes
codestyle fixes
codestyle fixes
codestyleci fixes
codestyle fixes
@qlty-cloud-legacy

Copy link
Copy Markdown

Code Climate has analyzed commit e487742 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Bug Risk 2

View more on Code Climate.

@n3storm

n3storm commented Sep 1, 2023

Copy link
Copy Markdown
Author

I don't know how to fix codeclimate issues, any clue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant