send variable to controller from route drupal 8 code example
Example: drupal 8 routing parameters
example.user:
path: '/example/{user}'
defaults:
_controller: '\Drupal\example\Controller\ExampleController::content'
requirements:
_permission: 'access content'
options:
parameters:
user:
type: entity:user