Add template library loading from FileSystem
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
|
||||
public class HBMustacheLibrary {
|
||||
init() {
|
||||
public init() {
|
||||
self.templates = [:]
|
||||
}
|
||||
|
||||
public init(directory: String) {
|
||||
self.templates = [:]
|
||||
self.loadTemplates(from: directory)
|
||||
}
|
||||
|
||||
public func register(_ template: HBMustacheTemplate, named name: String) {
|
||||
templates[name] = template
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user