Linking is much easier in XenForo 2 than in XenForo 1.
Outside of XenForo 2:
Inside an add-on in XenForo 2 might look like the following:
The
Outside of XenForo 2:
PHP:
\XF::app()->router()->buildLink( 'canonical:members', $latestUser )
Inside an add-on in XenForo 2 might look like the following:
PHP:
$this->buildLink('add-ons')
The
$this
references the current object.