I'm trying to upgrade old Drupal 7 modules to 8 and I am struggling to figure out how to create a blank page (by this I mean, a page with zero HTML from enabled themes) for my module. I added routing to my custom controller, my controller method takes care of all the logic and returns the following array:
[
'showVideo' => [
'#theme' => 'videoPage',
'#content' => $content
]
]
I already defined "videoPage" in mymodule.module using hook_theme:
Function mymodule_theme($existing, $type, $theme, $path){
return array(
'videoPage' => array(
'variables' => array('content' => NULL),
'file' => 'mymodule.html.twig'
)
);
}
"mymodule.html.twig" is a full stand-alone HTML file from the opening HTML tag to the closing tag. I don't want any other content to show up there but instead I'm getting the content in that Twig file, then followed by the HTML for the currently selected Drupal theme. Also, my {{ content.value }} calls in Twig seem to be getting ignored. And by this I mean, I can literally see {{ content.xyz }} in the markup being printed. The $content being returned by the controller is an array and I'm sure all the values are set. It almost feels like the Twig file is being called while the Controller's logic is being ignored. (this last bit has been solved by Clive's response)
Any help? Am I totally off in this approach?