FreeMarker

To generate HTML document with FreeMarker, you have to use the module voidframework-template-freemarker.


Installation

<dependency>
    <groupId>dev.voidframework</groupId>
    <artifactId>voidframework-template-freemarker</artifactId>
    <version>1.14.0</version>
</dependency>

Templates location

By default, templates should be placed in the resources/views directory.


Configuration

The following configuration keys can be used in the configuration file of your application:

  • voidframework.template.basePackagePath the location of the templates. The default value is "/views/".

Built-in methods & variables

By default, modules web and template-freemarker provide a set of methods and variables that will be accessible in templates.

MethodDescription
configRetrieves a value from the configuration
displaySizeDisplays a formatted number with the correct unit (Kio, Mio, Gio, …)
i18n / _Translates a message
urlforRetrieves an URL from the router (reverse router)
VariableDescription
isDevModeIndicates whether the application is in dev mode
langContains the current language
languagesContains all available languages
voidFrameworkVersionContains the current Void Framework version