# Need pointers in making my menu tree creator module better

**URL:** <https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697>\
**Category:** Components & MVC\
**Tags:** laminas-mvc, laminas-navigation\
**Created:** [May 16, 2024, 10:24am UTC](https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697 "2024-05-16T10:24:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [May 16, 2024, 10:24am UTC](https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697/1 "2024-05-16T10:24:17Z")

</div>

Hi, I’ve created a [module](https://github.com/ALTAMASH80/dynamic-bootstrap-menu-laminasmvc-doctrine) for Laminas MVC which might help someone to build menus. I just need pointers in making it better.  
Pointers

1. Which test would be about which test should I write to make it more appealing.
2. How to make it work with other navigation providers like the one @froschdesign has.
3. Views should be configurable or static. At the moment I’m using Laminas View with its default method Head Inline Script.
4. Form creation is pending. Suggestion for form creation is also welcome.

Thanks!

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [May 16, 2024, 1:12pm UTC](https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697/2 "2024-05-16T13:12:41Z")

</div>

The underlying package [laminas-mvc-bootstrap-menu](https://github.com/ALTAMASH80/laminas-mvc-bootstrap-menu) requires [LmcRbacMvc](https://github.com/LM-Commons/LmcRbacMvc) but this package is not listed in the Composer configuration. Unfortunately, the laminas-mvc-bootstrap-menu cannot be used without the LmcRbacMvc, even if I am already using a different check like ACL. An [optional listener](https://github.com/laminas/laminas-view/issues/202#issuecomment-1527184910) would be a solution here, like the [AclListener](https://github.com/laminas/laminas-view/blob/b3a44ac58829db56e1d6713c277370e260b57c64/src/Helper/Navigation/Listener/AclListener.php#L12) of laminas-view.

---

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [May 16, 2024, 3:29pm UTC](https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697/3 "2024-05-16T15:29:30Z")

</div>

Thanks @froschdesign for pointing out the inclusion of LmcRbacMvc as a mandatory component. I’ll remove it and make it appear in the suggestion.

---

<div class="post-metadata">

**Author:** ![Tyrsson](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/tyrsson/32/1664_2.png) [@Tyrsson](https://discourse.laminas.dev/u/Tyrsson)\
**Post date:** [May 16, 2024, 4:23pm UTC](https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697/4 "2024-05-16T16:23:52Z")

</div>

Possibly delegate this:

```auto
->setAuthorizationService($this->LmcRbacAuthorizationServiceHelper())

```

Does it support translation?

---

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [May 17, 2024, 6:45am UTC](https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697/5 "2024-05-17T06:45:24Z")

</div>

Hi @Tyrsson, I’ve no idea about translation in Authorization. But, If you’re asking about translation of navigation then it should work. As I’ve overridden the methods with the help of @froschdesign therefore it should work. But that is a good point. I’ll check that. Thanks!

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [May 17, 2024, 6:50am UTC](https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697/6 "2024-05-17T06:50:55Z")

</div>

> <https://github.com/ALTAMASH80/laminas-mvc-bootstrap-menu/blob/086a0895040c68cfde2eb06fe988927b188de1ef/src/View/Helper/Navigation/BootstrapSimpleMenu.php#L177>

> <https://github.com/ALTAMASH80/laminas-mvc-bootstrap-menu/blob/086a0895040c68cfde2eb06fe988927b188de1ef/src/View/Helper/Navigation/BootstrapSimpleMenu.php#L202>

---

<div class="post-metadata">

**Author:** ![Tyrsson](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/tyrsson/32/1664_2.png) [@Tyrsson](https://discourse.laminas.dev/u/Tyrsson)\
**Post date:** [May 17, 2024, 6:53am UTC](https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697/7 "2024-05-17T06:53:44Z")

</div>

That’s what I was asking about. I only had time for a quick glance earlier.

---

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [May 17, 2024, 7:10am UTC](https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697/8 "2024-05-17T07:10:45Z")

</div>

Thanks @froschdesign for that answer. If you had not pointed me in the right direction I would not have done so. Thanks for helping me put something out there as a contributor. If someone is wondering what that answer was, here is the [link](https://discourse.laminas.dev/t/how-to-override-navigation-or-menu-view-helper-plugin/2087).

---

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [May 17, 2024, 2:11pm UTC](https://discourse.laminas.dev/t/need-pointers-in-making-my-menu-tree-creator-module-better/3697/9 "2024-05-17T14:11:24Z")

</div>

Hi @froschdesign, As you’ve pointed out I have a dependency which forces a person to use LmcRbacMVC if the latest version or no version is given during composer install. Therefore, I’ve removed the dependency and given the developer the choice to download which version he/she wants. Thanks!
