From: Jason Woofenden Date: Fri, 6 Nov 2009 11:20:19 +0000 (-0500) Subject: added: tem_merge(), tem_merge_file() X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=8d25453fae8f4d0d49f45942417cab339ead58d0;p=wfpl.git added: tem_merge(), tem_merge_file() --- diff --git a/template.php b/template.php index 45857af..af66590 100644 --- a/template.php +++ b/template.php @@ -445,6 +445,13 @@ class tem { $this->template = merge_templates($this->template, $tem->template); } + # see merge() above + function merge_file($filename) { + $other_tem = new tem(); + $other_tem->load($filename); + $this->merge($other_tem); + } + function top_sub_names($is_sub = 'is_sub_template') { return array_keys(top_sub_templates($this->template, $is_sub)); } @@ -510,6 +517,16 @@ function tem_load($filename) { $GLOBALS['wfpl_template']->load($filename); } +function tem_merge($tem) { + tem_init(); + $GLOBALS['wfpl_template']->merge($tem); +} + +function tem_merge_file($filename) { + tem_init(); + $GLOBALS['wfpl_template']->merge_file($filename); +} + function tem_output($filename = false) { tem_init(); $GLOBALS['wfpl_template']->output($filename);