API Docs
This documentation is automatically generated from Flask-Menu’s source
code.
Decorators
Decorate endpoints that should be displayed in a menu.
Example:
@register_menu(app, '.', _('Home'))
def index():
pass
Parameters: |
- app – Application or Blueprint which owns the
function view.
- path – Path to this item in menu hierarchy,
for example ‘main.category.item’. Path can be an object
with custom __str__ method: it will be converted on first request,
therefore you can use current_app inside this __str__ method.
- text – Text displayed as link.
- order – Index of item among other items in the same menu.
- endpoint_arguments_constructor – Function returning dict of
arguments passed to url_for when creating the link.
- active_when – Function returning True when the item
should be displayed as active.
- visible_when – Function returning True when this item
should be displayed.
- dynamic_list_constructor – Function returning a list of
entries to be displayed by this item. Every object should
have ‘text’ and ‘url’ properties/dict elements. This property
will not be directly affect the menu system, but allows
other systems to use it while rendering.
|
Proxies
Root of a menu item.