How can I pass dynamically route parameters to module.links.action.yml?
My code of module.links.action.yml:
module.group_apply:
route_name: module.group_apply
title: 'Subscribe to group'
weight: 0
appears_on:
- entity.node.canonical
My code of module.routing.yml:
module.group_apply:
path: '/projects/{project}/usergroup/{group}/subscribe'
defaults:
_controller: '\Drupal\module\Controller\SubscriptionController::subscribe'
_title: 'Apply'
options:
parameters:
project:
type: entity:node
group:
type: entity:node
requirements:
_permission: 'access content'
My subscibe function (actually):
public function subscribe(NodeInterface $project, NodeInterface $group) {
return array(
'#markup' => 'HERE WE GO!',
);
}