Twig template variable not displaying value I have a Twig template for a custom block. My custom module is establishing what template is used like so

function mymodule_theme($existing, $type, $theme, $path){
    return array('mymodule' =&gt;
        array(
            'variables' =&gt; array(
                'header-title' =&gt; 'Default Title',
                'header-size' =&gt; 'h1'
                ), 
                'template' =&gt; 'block--HeaderText'
            )
        );
}


and my custom block contains.

public function build() {
    return array(
        '#theme' =&gt; 'mymodule',
        '#title' =&gt; '',
        '#header-title' =&gt; $this-&gt;configuration['label'],
        '#header-size' =&gt; $this-&gt;configuration['header-size-submit'],
        );
}


And in my block--HeaderText.html.twig I have

&lt;h2&gt;{{ header-title }}&lt;/h2&gt; This is a test {{ header-size }}
{{ dump() }}


However header-title and header-size both output 0. But using the dump() function in the template shows that the actual variables are available some how.

The dump() produces

array(15) { ["header-title"]=&gt; string(19) "Header Textsdfgsdfg" ["header-size"]=&gt; string(2) "h4"...


Yet {{ header-title }} just results in 0.
The issue was that Drupal didn't like that the variable names had hyphens in them. 
When switching from header-text to header_text it worked fine.