I’d like to create a menu item that has a dynamic variable in it, specifically the user’s id.
In my example.routing.yml I have this:
example.test: path: '/user/{user}/example' defaults: _controller: 'DrupalexampleControllerExampleController::test' _title: 'Test' requirements: _permission: 'access content' user: ^[0-9]+
In my example.links.menu.yml, I have:
example.testlink: title: Test Link parent: example.parent description: 'Test Link' route_name: example.test weight: 3 route_parameters: {user: 5}
That “5” is my user id, I’d like to have it pull dynamically from my logged in user. Is that possible?
Sponsored by SupremePR