Data returned from the controller is not showing in the template file
I don't know what exactly you are trying to do as var never seems to be passed an array or object but I'll give you a working example. Your controller should extend ControllerBase and use public function content() to output stuff. Also pay attention to reference the correct namespace and pay attention to upper and lower case writing as well.

module.info.yml

name: Module
description: Module description
package: Custom
type: module
version: 1.0
core: 8.x


module.module

function module_theme($existing, $type, $theme, $path) {
  return [
    'module_template' =&gt; [
      'variables' =&gt; [
        'var'   =&gt; NULL,
        'title' =&gt; NULL,
      ],
    ],
  ];
}


module.routing.yml

module.event:
  path: '/path/{user}'
  defaults:
    _controller: '\Drupal\module\Controller\Controller::content'
    _title: 'Module'
  requirements:
    _permission: 'access content'


templates/module-template.html.twig

&lt;p&gt; test {{ title }}&lt;/p&gt;
&lt;div&gt;{{ var.getUsername }}&lt;/div&gt;
test 2


src/Controller/Controller.php

namespace Drupal\module\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Session\AccountInterface;

class Controller extends ControllerBase {

  public function content(AccountInterface $user) {

    return [
      '#theme' =&gt; 'module_template',
      '#var'   =&gt; $user,
      '#title' =&gt; 'Title',
    ];
  }

}




Now you can access /path/1 or whatever user ID you want to get this user's name printed.

With the Devel sub-module Kint installed you can use {{ kint() }} or {{ kint(var) }} inside the template to check out what else you can get and print.