Closed luishdez closed 9 years ago
oh f... sorry for that one. very stupid, we run into a name clash about "name"
i think the only sane solution is to call our thing routeName and setRouteName / getRouteName. luckily there is no release yet of this version.
can you do a pull request to adjust RouterGenerateEvent and the DynamicRouter accordingly? if not, i can do that soonish.
Sure no problem!
Checking the event I see that this is the name of the route or an instance of Route. Shouldn't we call this just route
? getRouteName() and getting a route instance doesn't seem very logic.
/**
* The name of the route or the Route instance to generate.
*
* @var string|Route
*/
private $name;
indeed, forgot about that. yes, very good point. lets call this getRoute then.
Now all my {{ paths(...) }} try to load 'cmf_routing.pre_dynamic_generate' instead the original name of the route.
I found that the route is being override by the event name
https://github.com/symfony-cmf/Routing/blob/master/DynamicRouter.php#L174
Note: That getName() method in event for Symfony 3.0 is deprecated so I guess this will work with 3.0