adding finalized test.php code for the "generate template" page