Active
Project:
Drupal core
Version:
main
Component:
documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 May 2020 at 23:59 UTC
Updated:
10 May 2020 at 18:12 UTC
Jump to comment: Most recent
Follow-up https://www.drupal.org/project/drupal/issues/3123211#comment-13605892
@xjm:
One could make the case that menu.api.php should give an example of using the service properly rather than assuming the example is for procedural or test code, but rewriting docs is a separate issue scope. Tagging "needs followup" for that.
Add an example near https://git.drupalcode.org/project/drupal/-/blob/8.8.x/core/lib/Drupal/C...
# foo_module.services.yml
foo_module.menu_link_tree_consumer
class: \Drupal\foo_module\MenuLinkTreeConsumer
arguments: ['@menu.link_tree']
# foo_module/src/MenuLinkTreeConsumer.php
...
Comments
Comment #2
kristen pol