Changed hardcoded .php extension to ->templateExtension to support custom template engines
Render the page instead of the template file - this is what most hooks that alter the rendered output are attached to.