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

Can you pass parameters through XenForo_ControllerResponse_Redirect?

Jaxel

Well-known member
#1
Okay... lets say I am doing the following:
Code:
return $this->responseRedirect(
	XenForo_ControllerResponse_Redirect::SUCCESS,
	XenForo_Link::buildPublicLink('media', $media)
);
In addition to sending the user to the new page, I also want to send the user a string parameter. For instance, if I am redirecting a user to a media page, I want to also tell them why I am sending them to the media page. As well, can I do this from a DataWriter? In my DW I am checking to see if a media is unique; if its not unique I don't want to print out a general error. Instead I want to redirect them to the existing video and send the general error through a parameter.
 

Shadab

Well-known member
#2
3rd parameter to responseRedirect() would be the message (string) you want to show.

If your html form is classed as "AutoValidator", the message would be shown as a slide-down for a few seconds before the user is redirected to the target url, automatically.