I'm afraid this sounds like another job for advanced themes - you can output whatever you want for a custom page by overriding the main() function and checking based on $this->request if it's your special page. If so, do whatever you want in PHP, otherwise call qa_html_theme_base::main() to let Q2A do its usual thing.