I'm assuming you have one template as a main container and your other templates would be internal nested templates....
Basically.. use
PHP Code:
eval('$var = "' . fetch_template('template_name') . '";');
Throughout your code. Then in the main template include $var where you want the internal templates to appear. Then call the master template at the end of the php file with
PHP Code:
eval('print_output("' . fetch_template ...