Hook theme path to template in a folder For my template I need to point to a subfolder in templates folder: templates/sub-folder/my-wall1.html.twig, the file is there, but nothing works. 

What are the rules?


translate minus (-) to underscore (_)
...

function my_module_theme() {
  return [
    'wall1' =&gt; [
      'template'  =&gt; 'sub_folder/my_wall1',
      'variables' =&gt; [
        'w1' =&gt; NULL
      ],
    ],
  ];
}



Update: According to the answers, I tried the following:


test/test.html.twig &lt; does not work
test.html.twig &lt; works, without subfolder and a name like this


An example or point to documentation would be great too?!
Thanks.
Drupal uses filenames only for theme suggestions 'template' =&gt; 'my_wall1'. But you can still place the template in a subfolder below templates and Drupal will still discover it.

Not tried this myself, but according to hook_theme() documentation: You can add a drupal root relative path if you want a very specific directory for the Twig file:

function my_module_theme() {
  return [
    'wall1' =&gt; [
      'template'  =&gt; 'my_wall1',
      'variables' =&gt; [
        'w1' =&gt; NULL
      ],
      'path' =&gt; 'DRUPAL_ROOT_RELATIVE_PATH'
    ],
  ];
}