URL generation method?

Renari

Member
Is there one? I assume so since Xenforo supports using modrewrite to make more friendly URL. But I can't seem to find it.
 
What specifically are you needing to know or trying to do?

The class responsible for building URLs is XenForo/Link.php if that helps.
 
Thanks I figured it out.
Code:
$link = Xenforo_Link::buildPublicLink("members/{username}.{id}");

Will generate a link to the users profile.
 
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.
 
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'  );
 
Top Bottom