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

URL generation method?

#5
Thanks I figured it out.
Code:
$link = Xenforo_Link::buildPublicLink("members/{username}.{id}");
Will generate a link to the users profile.
 

Jake Bunce

XenForo moderator
Staff member
#6
That works, but this is more correct:

Code:
$link = XenForo_Link::buildPublicLink('members', $user);
Where $user is the user record or is an array which contains at least the username and user_id.
 

Marcus

Well-known member
#8
You can see that in the official xenforo code ( $this->responseRedirect ...) like here (which is a custom code):

PHP:
 return $this->responseRedirect(
XenForo_ControllerResponse_Redirect::SUCCESS,
  XenForo_Link::buildPublicLink('members/mobileedit'),
  'You just changed your mobile number'  );