I have a local links.task.yml
file to display the tab for the node data , But it seems to have a problem passing argument to the path . As you can see I am extending the node's basic fetaures like edit,delete.revision with an additional function using tab. I have module_name.links.task.yml
entity.node.check_backend:
route_name: module_name.my_route
base_route: entity.node.canonical
title: My title
And I have the route in module_name.routing.yml
as follows:
module_name.my_route:
path: '/node/{arg1}/function_name'
defaults:
_controller: '\Drupal\module_name\Controller\ControllerName::function_name'
_title: 'My title'
requirements:
_permission: 'access admin tab'
But it throws me errors like:
Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("arg1") to generate a URL for route "module_name.my_route".
How can I pass variables in links.task.yml file ?
{node}
so the existing node routing can work with it. Can you try that in your routing file?