JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added: tem_merge(), tem_merge_file()
authorJason Woofenden <jason@jasonwoof.com>
Fri, 6 Nov 2009 11:20:19 +0000 (06:20 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Fri, 20 Nov 2009 00:02:49 +0000 (19:02 -0500)
template.php

index 45857af..af66590 100644 (file)
@@ -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);