Your controller has a protected property, that defaults to Fluid, changing it to something else is really easy:
protected $viewFormatToObjectNameMap = array('json' => '\TYPO3\FLOW3\MVC\View\JsonView');
Now take a look at the EmptyController in the same directory: \TYPO3\FLOW3\MVC\View\
You can use this as start. What you basically have to do is to satisfy an assign method, the way how you can transfer variables to your theme.
Next, come up with a few standardizations (e.g. the Template-Files have to be in the folder \Resources\Private\Templates\ControllerName\ActionName.phtml, note the file extension) and say which variable will be available there (e.g. $view).
Now a very basic approach would be:
protected $view = array();
public function assign($key, $value) {
$this->view[$key] = $value;
}
public function render() {
$this->controllerContext->getResponse()->setHeader('Content-Type', 'text/html');
$view = $this->view;
ob_start();
include_once($this->getTemplatePathAndFilename());
$output = ob_get_contents();
ob_end_clean();
return $output;
}
}
For the $this->getTemplatePathAndFilename() function, you can use the code from the TYPO3\Fluid\View\TemplateView->getTemplatePathAndFilename() method and adjust it to your needs.
In your template files, you can now use the $view variable.
I'm at my parents for easter and they lack a runtime environment, so this is not tested and you'll likely run into problems, but this should get you started!