diff --git a/doc/02-Twig-Integration.markdown b/doc/02-Twig-Integration.markdown index 1ab364b7..cbafa4bf 100644 --- a/doc/02-Twig-Integration.markdown +++ b/doc/02-Twig-Integration.markdown @@ -181,6 +181,8 @@ menu object in the other functions: {{ knp_menu_render(['main', 'Comments', 'My comments'], {'depth': 2}) }} {% set item = knp_menu_get('sidebar', ['First section']) %} + +{% set breacrumbs_array = knp_menu_get_breadcrumbs_array('main') %} ``` In some cases, you may want to build the menu differently according to the @@ -273,3 +275,21 @@ want. >**NOTE** >The built-in templates contains some additional blocks to make it easier >to customize it when using the inheritance. + +Twig integration reference +-------------------------- + +### Functions + +* `knp_menu_get('menuName' [, ['Path', 'To', 'Item'], ['options']])`: retrieve an item of the menu +* `knp_menu_render('menuName' [, ['options'], 'rendererName'])`: render a menu +* `knp_menu_get_breadcrumbs_array('menuName' [, 'subItem'])`: get an array that represent the breadcrubs of the current page (according to the menu) + +### Filters + +* `knp_menu_as_string(menuNode [, $separator])`: generate a string representation of the menu item + +### Tests + +* `knp_menu_current`: check if the item is the current one +* `knp_menu_ancestor`: check if the item is the ancestor of a current item