KnpLabs/KnpMenuBundle — Issue #92: Injected Request '_route' attribute is empty
Author: kgilden
Created: 2011-12-23 15:11:53+00:00
State: open

It seems my Request object is missing the '_route' attribute when injected to a menu builder with some custom components (factory and renderer). However, the '_controller' attribute is correctly there. I also have a second builder, which uses the built-in factory as well as the renderer and the '_route' attribute is set there. Here's the relevant part of my code.

Services:

%kernel.charset%

Here's the builder

createItem('root');

$request = $this->container->get('request');
$route = $request->attributes->get('_route');
var_dump($route); // RETURNS NULL

/* snip */
}

/* snip */
}

My menu is rendered by using ´{{ knp_menu_render('archive', {}, 'archive') }}´

What am I missing here?