In block controller.php set template

How can I in a controller of a block set the template the block is using. I’d like to switch between two templates, depending on a set of GET parameters when the page is called.

Is that possible? Or is it a bad idea because of caching in any case?

Thank you. I’ve tried this before as I saw it, but I am getting an “undefined function” error…

Found it. Very simple:

In a blocks controller.php view method, simply use: