X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=template.php;h=af66590a84928c4455590f3b7cec8df0992ac3b1;hb=8d25453fae8f4d0d49f45942417cab339ead58d0;hp=45857afcecde5532be9c7651ac7a7bbb552bf29a;hpb=0c70f6a8cdf46b61c8d30f918833b8f2d8522009;p=wfpl.git 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);