FileSystemLoader class
Loads templates from the file system.
This loader can find templates in folders on the file system and is the preferred way to load them:
var loader = FileSystemLoader(path: 'templates', ext: ['html', 'xml']))
var loader = FileSystemLoader(paths: ['overrides/templates', 'default/templates'], ext: ['html', 'xml']))
Default values for path templates
and file ext. ['html']
.
To follow symbolic links, set the followLinks parameter to true
var loader = FileSystemLoader(path: 'path', followLinks: true)
Constructors
Properties
- encoding → Encoding
-
final
-
extensions
→ Set<
String> -
final
- followLinks → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasSourceAccess → bool
-
no setterinherited
-
paths
→ List<
String> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
findFile(
String path) → File? -
getSource(
String path) → String -
Get template source from file.
override
-
isTemplate(
String path, [String? from]) → bool -
listTemplates(
) → List< String> -
Iterates over all templates.
override
-
load(
Environment environment, String path) → Template -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited