I want to replace the emailtemplates
router to contactpoints
from the following URL
http://localhost/app_dev.php/config/workflow/configset-72/partner_site/emailtemplates
My routing pattern is: /config/workflow/configset-{configSetId}/partner_site/{steps}
I am currently using following code to generate a URL. But in this way I have to redefine the confgSetId
, so, is there any other way to replace only "steps
" (emailtemplates
with contactpoints
) route pattern?
$routes = new RouteCollection();
$routes->add('deploy_config', new Route('/config/workflow/configset-{configSetId}/partner_site/{steps}'));
$context = new RequestContext();
$context->fromRequest($this->getRequest());
$urlGenerator = new UrlGenerator($routes, $context);
$r = $urlGenerator->generate('deploy_config', array('configSetId' => $this->getConfigSet()->getId(), 'steps' => 'contactpoints'));
If I ask it simply I want to know: How to edit current URL inside a controller in Symfony2?