The latter is the way to go:
Controllers take the request and handle it, while Views should do a pure transformation of the inputs the controller provided to the needed output format (html, json, …).
The template is part of the view module, not something separate.