I am looking for a way to override the generation of the url for a specific route in Symfony2. In symfony 1.4 I used to do it like this:
RouteName:
class: sfDoctrineRouteCollection
options:
model: Model
prefix_path: /route/:id/:slug
column: id
route_class: CustomDoctrineRoute
class CustomDoctrineRoute extends sfDoctrineRoute
{
public function generate($params, $context = array(), $absolute = false)
{
//custom logic on route params
return parent::generate($params, $context, $absolute);
}
}