I have render array like this.
$array = [
'#theme' => 'theme_wrap',
'#content' => $data,
'#contextual_links' => [
'my_module' => [
'my_module.router.name', $pid
]
]
and theme-wrap.html.twig
{%
set classes = [
'contextual-region'
]
%}
<div {{ attributes.addClass(classes) }}>
{{ title_prefix }}
{{ title_suffix }}
{{ content }}
</div>
and file mymodule.links.contextual.yml
mymodule.admin.edit:
title: 'Edit'
route_name: my_module.router.name
group: my_module
and route name my_module.router.name exited and working. Render data array working but don't see contextual link.
Update: I have a form to user can enter input. After submit i'll show data from user. And simple controller return array above. - I have insert {{ title_suffix }},{{ title_prefix }} class contextual-region but don't working.
I was doing something wrong? Please help!