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?

https://documentation.concretecms.org/api/9.1.1/Concrete/Core/Block/Block.html#method_setCustomTemplate

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:

$this->render(‘templates/yourtemplatefoldername/view’);