|
@@ -22,8 +22,11 @@ class TemplateLoader(object):
|
22
|
22
|
# TemplateLoader)
|
23
|
23
|
# @param template_vars dict : parameters to be used in the template
|
24
|
24
|
# @return str. String containing the HTML output of the processed templated
|
25
|
|
- def render_to_html(self, template_file, template_vars):
|
|
25
|
+ def render_to_html(self, template_file, template_vars={}, template_extra={}):
|
26
|
26
|
loader = jinja2.FileSystemLoader(searchpath=self.search_path, followlinks=self.follow_links)
|
27
|
27
|
environment = jinja2.Environment(loader=loader)
|
28
|
28
|
template = environment.get_template(template_file)
|
|
29
|
+ if template_extra is not None or template_extra != {}:
|
|
30
|
+ for extra in template_extra:
|
|
31
|
+ template.globals[extra[0]] = extra[1]
|
29
|
32
|
return template.render(template_vars)
|