Closed apauly closed 10 years ago
Hi.
The GRMustacheTemplateRepository class is your friend.
Pick one of the factory methods templateRepositoryWithDirectory:templateExtension:encoding:
, templateRepositoryWithBaseURL:templateExtension:encoding:
or templateRepositoryWithBundle:templateExtension:encoding:
.
Then, load templates with [repo templateNamed:error:]
.
Wrapping all this up, this would give something like:
GRMustacheTemplateRepository *repo = [GRMustacheTemplateRepository templateRepositoryWith...];
GRMustacheTemplate *template = [repo templateNamed:...];
NSString *rendering = [template renderObject:... error:...];
Thanks, I didn't notice those methods. Works great!
You're welcome :smile:
It would be great if the default
GRMustacheDefaultExtension
would be configurable. We'd like to use "html.mustache" as the extension. We share our mustache templates with other implementations so it is nontrivial to change the filenames to match the given "mustache" extension.