XF 2.0 Can I take any variables with me in "return $this->redirect($this->buildLink"

AndrewSimm

Well-known member
What I am trying to do is display a success or failure popup box which will be set on a variable under this action. Is there a way I can take a a variable with me to the page I am redirected too? I would prefer to not have to use get, so that it doesn't create a permanent link to a success or failed message. I also would like to note have to do a double redirect.
 
I assume you're referring to doing something in JS with those values, in which case you can set additional parameters which will be in the JSON output. As an example (from thread quick closing):
Code:
$reply = $this->redirect($this->getDynamicRedirect());
$reply->setJsonParams([
   'text' => $text,
   'discussion_open' => $thread->discussion_open
]);
 
Top Bottom