I’ve a customized menu MyMenu and I’ve 4 menu objects. What I wish to do is so as to add Drupal Development Company present uid as a parameter at Drupal Development Company finish of Drupal Development Company hyperlink.
In D7 I may use menu_tokens module which isn’t out there on D8.
I attempted to create a routing file in my customized module.
So in my routing file MY_MODULE.routing.yml I added :
MY_MODYLE.my_applications_redirect: path: '/my-applications' defaults: _controller: 'DrupalMY_MODULEControllerMyApplicationController::redirect_to_my_applications'
And in MyApplicationController.php :
namespace DrupalMY_MODULEController; use DrupalCoreControllerControllerBase; use SymfonyComponentHttpFoundationRedirectResponse; /** * A controller that redirects to Drupal Development Company my purposes web page. */ class MyApplicationController extends ControllerBase { /** * {@inheritdoc} */ public perform redirect_to_my_applications() { international $base_url; $person = Drupal::currentUser(); $path = '/my-applications/'. $user->id(); $response = new RedirectResponse($base_url . $path); $response->ship(); } }
Additionally in Drupal Development Company menu I’ve set Drupal Development Company path to /my-applications.
Do I miss one thing?
PS. Drupal Development “my-applications” web page is a panel web page.