Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

n3storm
Copy link

@n3storm n3storm commented Sep 1, 2023

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)
*/
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

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'.

*/
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

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
@codeclimate
Copy link

codeclimate bot commented Sep 1, 2023

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
Copy link
Author

n3storm commented Sep 1, 2023

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