Evening to all,
I'm developing a breadcrumbs system by a KNP Menu ready coded. I'm getting a problem when trying to get breadcrumbs with theis own URI and name for a tree.
E.g: For /menuItem1/category1/ I am looking for Menuitem --> Category1
To match current URI with Child URI, I'm using this structure:
$matcher = new Matcher();
$voter = new UriVoter($_SERVER['REQUEST_URI']);
$matcher->addVoter($voter);
$treeIterator = new \RecursiveIteratorIterator(
new \Knp\Menu\Iterator\RecursiveItemIterator(
new \ArrayIterator(array($trail))
),
\RecursiveIteratorIterator::SELF_FIRST
);
$breadcrumbs = new \Knp\Menu\Iterator\CurrentItemFilterIterator($treeIterator, $matcher);
The problem is that I get the complete trail for the breadcrumbs butnot their own links. Any sugestions? Not much time. I'll explain better if someone need it.
Thanks in advance.
EDIT: Now I can retrieve current menu item but what I want is to get Current Menu Item and their parents (names and links).