rlandster
rlandster

Reputation: 7825

symfony redirect loses parameter

I have a symfony 1.4 project with this routing rule in my main application:

registration_profilechoice:
  url: register/profiles/:restricted_data
  param: { module: register, action: profileChoices, restricted_data: nonrestricted }

In the index action for this module I am trying to redirect to register/profiles/restricted using

$this->redirect("register/profiles/restricted");

Looking at the log, the above command results in this:

{sfFrontWebController} Redirect to "https://mdm-dev1.stanford.edu/client.php/register/profiles"

What happened to the restricted parameter?

Upvotes: 0

Views: 238

Answers (1)

Dan Grossman
Dan Grossman

Reputation: 52372

You're not supposed to hard code URLs like that, that's the whole purpose of having a routing system... you can change the URL without changing all your links.

$this->redirect('@registration_profilechoice?restricted_data=restricted');

Upvotes: 3

Related Questions