Skip to content

Commit 1a7bb26

Browse files
committed
Merge pull request #206 from Nek-/doc/twig-reference
Added twig reference to documentation
2 parents ee1cc7e + ea5a4f1 commit 1a7bb26

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/02-Twig-Integration.markdown

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ menu object in the other functions:
181181
{{ knp_menu_render(['main', 'Comments', 'My comments'], {'depth': 2}) }}
182182
183183
{% set item = knp_menu_get('sidebar', ['First section']) %}
184+
185+
{% set breacrumbs_array = knp_menu_get_breadcrumbs_array('main') %}
184186
```
185187

186188
In some cases, you may want to build the menu differently according to the
@@ -273,3 +275,21 @@ want.
273275
>**NOTE**
274276
>The built-in templates contains some additional blocks to make it easier
275277
>to customize it when using the inheritance.
278+
279+
Twig integration reference
280+
--------------------------
281+
282+
### Functions
283+
284+
* `knp_menu_get('menuName' [, ['Path', 'To', 'Item'], ['options']])`: retrieve an item of the menu
285+
* `knp_menu_render('menuName' [, ['options'], 'rendererName'])`: render a menu
286+
* `knp_menu_get_breadcrumbs_array('menuName' [, 'subItem'])`: get an array that represent the breadcrubs of the current page (according to the menu)
287+
288+
### Filters
289+
290+
* `knp_menu_as_string(menuNode [, $separator])`: generate a string representation of the menu item
291+
292+
### Tests
293+
294+
* `knp_menu_current`: check if the item is the current one
295+
* `knp_menu_ancestor`: check if the item is the ancestor of a current item

0 commit comments

Comments
 (0)