Add uid to existing menu link I have a custom menu MyMenu and I have four menu items. 
What I want to do is to add the current uid as a parameter at the end of the link.

In D7 I could use menu_tokens module which is not available on D8. 

I tried to create a routing file in my custom module.

So in my routing file MY_MODULE.routing.yml I added :

MY_MODYLE.my_applications_redirect:
  path: '/my-applications'
  defaults:
_controller: '\Drupal\MY_MODULE\Controller\MyApplicationController::redirect_to_my_applications'


And in MyApplicationController.php :

namespace Drupal\MY_MODULE\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\RedirectResponse;

/**
 * A controller that redirects to the my applications page.
 */
 class MyApplicationController extends ControllerBase {

  /**
   * {@inheritdoc}
   */
  public function redirect_to_my_applications() {

    global $base_url;
    $user = \Drupal::currentUser();
    $path = '/my-applications/'. $user-&gt;id();

    $response = new RedirectResponse($base_url . $path);
    $response-&gt;send();
  }

}


Also in the menu I have set the path to /my-applications.

Do I miss something?

PS. The "my-applications" page is a panel page.
As i can see from the menu token that the module has a pre-released version for drupal 8 as development release, so maybe you could try it out or at least search in its code to find a way to accomplish your needs.

I have recently built a drupal 7 website and i have used the menu token to create a hover over drop down usermenu with username and profile picture.

See image below (i drawed in black on top of it because the site in not yet online)


If you like, i can right back small tutorial on how i achieved that !