I'm getting started with plugin/module development. I want to get the template file, pass some variables to it, and get rendered HTML of that template into a string variable.
How do I do that?
I figured it out. I will paste it here in case someone needs it:
$html = Craft::$app->getView()->renderTemplate('template.twig', $variables);