Implements Drupal\Core\PathProcessor\OutboundPathProcessorInterface::processOutbound().
Overrides OutboundPathProcessorInterface::processOutbound
public function processOutbound($path, &$options = array(), Request $request = NULL) {
// Rewrite user/uid to user/username.
if (preg_match('!^user/([0-9]+)(/.*)?!', $path, $matches)) {
if ($account = user_load($matches[1])) {
$matches += array(
2 => '',
);
$path = 'user/' . $account->name . $matches[2];
}
}
// Rewrite forum/ to community/.
if ($path == 'forum' || strpos($path, 'forum/') === 0) {
$path = 'community' . substr($path, 5);
}
return $path;
}