menus.exthere is a list of all the menu items. This can be useful when working with navbars and layouts, where you sometimes need to loop over menu items multiple times.
get_link/2function, which takes a
current_useras the parameters. The
nameparameter is pattern matched and thus you statically include it in the function definition. A menu item has a name, label, path and icon. Here's an example of a menu item for the "Register" menu item:
current_userparam to conditionally display a menu item. For example, here we don't show the menu item unless the user is an admin.