Changing the TNew Template from one .html file to a .php file with query parameters, where do I set the template?

I need to update my TNew template from the existing HTML file to a new .PHP file that has two different headers/footers and the chosen option will be determined by the query parameters. I have the PHP file set up and running, I simply don't know where to assign it so that it will start being used.