KnpLabs/KnpMenu — pull request #45 by stof (2012-04-17 21:05:30+00:00)
Title: Added a first implementation of a BreadcrumbRenderer

This is a WIP about #24 meant for discussion.

This implementation uses the ``getBreadcrumbsArray`` method, making it easy to append additional stuff at the end of the breadcrumb. However, it means that you are limited when rendering each item as you only have the label and the uri. The other solution would be to build an array of items or to call getParent each time, but it would make it harder to pass additional paths as it would require building items for them (in this regards, an array of items would be easier than calling ``getParent`` during the rendering though as we don't need to add the new items in the existing menu tree).

To use it, you need to call the ``knp_menu_render`` method with the item corresponding to the end of the breadcrumbs, i.e. the item for which the breadcrumb is rendered (except the additional path of course). This is a good use case to [get an item by path in the tree](https://github.com/KnpLabs/KnpMenu/blob/master/doc/02-Twig-Integration.markdown#get-item-by-path)