Returning HTML from a controller I have followed the guide at http://befused.com/drupal/first-drupal8-module to create a simple Drupal 8 controller, and it works as described. Instead of printing "Hello World" I would like to create more complex HTML.
I found a guide that appears to step through what I need to do at http://jonathanpatrick.me/blog/safe-markup. I added hook_theme to my flot_d8.module file:

function flot_d8_theme(array $existing, $type, $theme, $path) {
  return array(
    'flot_d8_my_template' =&gt; array(
      'template' =&gt; 'my-template',
      'variables' =&gt; array(
        'variable1' =&gt; NULL,
        'variable2' =&gt; NULL,
      ),
    ),
  );
}


and created the my-template.html.twig file exactly as shown:

&lt;div class="my-template"&gt;
  This is the first variable: &lt;b&gt;{{ variable1 }}&lt;/b&gt;.
  This is the second variable: &lt;i&gt;{{ variable2 }}&lt;/i&gt;.
&lt;/div&gt;


I'm guessing my problem is in the way I try to call the theme. My controller code is:
   

namespace Drupal\flot_d8\Controller;
use Drupal\Core\Controller\ControllerBase;
class Flot_d8 extends ControllerBase {
  public function content() {
    return [
      '#theme' =&gt; 'flot_d8_my_template',
      '#variable1' =&gt; t("First"),
      '#variable2' =&gt; t("Second"),
    ];
  }
}


Is this the correct way to print a &lt;div&gt; to the screen? Do I need to register the template file in my info file somewhere?
I removed the template line from hook_theme and renamed the file to flot-d8-my-template. Cleared the cache and it worked.