• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

AndrewSimm

Active member
#1
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.
 

Mike

XenForo developer
Staff member
#2
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
]);