From 8d25453fae8f4d0d49f45942417cab339ead58d0 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Fri, 6 Nov 2009 06:20:19 -0500 Subject: [PATCH] added: tem_merge(), tem_merge_file() --- template.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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); -- 1.7.10.4