-
Notifications
You must be signed in to change notification settings - Fork 48
Conversation
return $breadcrumbs; | ||
} | ||
|
||
return array_merge($breadcrumbs, $this->getBreadcrumbArray($item->getParentObject())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a fast way to get the current item and all its parents in one call (query) with PHPCR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not built-in. but we do this for the route loading: https://github.com/symfony-cmf/Routing/blob/master/Candidates/Candidates.php#L141-L147
if we are PHPCR specific here, i guess its safe to do the same (assume that /
is separator for the id). if i remember correctly, $dm->findMany also preserves the order. in the linked example, we want to go from child to parent (routing wants to match the most specific possible) while here you want to invert the order to have parent first.
sounds good to me!
|
Let's skip this for 2.0, it contains to much bugs (especially not being able to select menu node with content) and I cannot really discover if it's faster or not (blackfire says it's faster, but shows lots of unrelated stuff in the tree). |
pls reopen if still interessted. |
The KnpMenu library is a very generic library, providing tools which can be used in many apps. The CMF however is much more specific, implementing a much better backend for trees (PHPCR) and having a specific way to store the current content/route.
This means that a lot of things can be done much more efficient (e.g. retrieving the current item and generating a breadcrumb array). This PR is a proof of concept and a very early sketch of some faster templating helpers.
Partly fixes #19