1

I'm porting a legacy system that uses Symfony framework. I have almost no experience on Symfony at all.

I need to overwrite a route to an action to an external site and including a session value as a parameter.

This is the current routing.yml code

mysystemtool:
  url:   /:module/mysystemtool/tool/*
  param: { action: mysystemtool }

And I need to redirect to a url like http://thirdpartyurl.com/?session_param=session_value

Any idea how to do this?

4

1 に答える 1

10

You cant route it perse becuase routing is only for internal stuff. That said you can redirect in the controller:

public function executeMysystemtool(sfWebRequest $request) {

    $param = $this->getUser()->getAttribute('session_param', 'default_value');
    $this->redirect('http://thirdpartyurl.com?session_param='.$param);
}

Of course you need your actions.class.php set up in a module so that you can code this action but if its an existing action then you should just have to change the logic in the action.

于 2012-07-09T22:58:56.793 に答える