Load a template from a string. This parses the source given and returns a :class:`Template` object.
(self, source, globals=None, template_class=None)
| 872 | return self.select_template(template_name_or_list, parent, globals) |
| 873 | |
| 874 | def from_string(self, source, globals=None, template_class=None): |
| 875 | """Load a template from a string. This parses the source given and |
| 876 | returns a :class:`Template` object. |
| 877 | """ |
| 878 | globals = self.make_globals(globals) |
| 879 | cls = template_class or self.template_class |
| 880 | return cls.from_code(self, self.compile(source), globals, None) |
| 881 | |
| 882 | def make_globals(self, d): |
| 883 | """Return a dict for the globals.""" |
no test coverage detected