class Marten::Conf::GlobalSettings::Templates
- Marten::Conf::GlobalSettings::Templates
- Reference
- Object
Overview
Allows to configure templates-related settings.
Defined in:
marten/conf/global_settings/templates.crInstance Method Summary
-
#app_dirs : Bool
Returns a boolean indicating whether templates should be looked for inside installed applications.
-
#app_dirs=(app_dirs : Bool)
Allows to set whether templates should be looked for inside installed applications.
-
#cached : Bool
Returns a boolean indicating whether templates should be kept in a memory cache upon being loaded and parsed.
-
#cached=(cached : Bool)
Allows to set whether templates should be kept in a memory cache upon being loaded and parsed.
-
#context_producers : Array(Marten::Template::ContextProducer.class)
Returns an array of context producers that will be used to populate the context for each template.
-
#context_producers=(v)
Allows to set the context producers that will be used to populate the context for each template.
-
#dirs : Array(String)
Returns an array of directories where templates should be looked for.
-
#dirs=(dirs : Array(Path | String | Symbol))
Allows to set the directories where templates should be looked for.
-
#strict_variables : Bool
Returns
true
if the strict variables mode is enabled. -
#strict_variables=(strict_variables : Bool)
Alows to enable or disable the strict variables mode.
-
#strict_variables? : Bool
Returns
true
if the strict variables mode is enabled.
Instance Method Detail
Returns a boolean indicating whether templates should be looked for inside installed applications.
Allows to set whether templates should be looked for inside installed applications.
Returns a boolean indicating whether templates should be kept in a memory cache upon being loaded and parsed.
Allows to set whether templates should be kept in a memory cache upon being loaded and parsed.
By default templates will be read from the filesystem and parsed every time they need to be rendered. When
setting this configuration option to true
, compiled templates will be kept in memory and further renderings
of the same templates will result in previous compiled templates to be reused.
Returns an array of context producers that will be used to populate the context for each template.
Allows to set the context producers that will be used to populate the context for each template.
Returns an array of directories where templates should be looked for.
The order of these directories is important as it defines the order in which templates are searched for.
Allows to set the directories where templates should be looked for.
Alows to enable or disable the strict variables mode.
When this setting is set to true
, unknown variables encountered in templates will result in
Marten::Template::Errors::UnknownVariable
exceptions to be raised.