io.vertx.ext.web.templ

## Interface TemplateEngine

- All Known Subinterfaces:
    FreeMarkerTemplateEngine, HandlebarsTemplateEngine, JadeTemplateEngine, MVELTemplateEngine, PebbleTemplateEngine, ThymeleafTemplateEngine

      public interface TemplateEngine

  A template engine uses a specific template and the data in a routing context to render a resource into a buffer.

  Concrete implementations exist for several well-known template engines.

  Author:
    Tim Fox

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `default boolean` | `isCachingEnabled()` Returns true if the template engine caches template files.
    `default void` | `render(RoutingContext context, String templateFileName, Handler<AsyncResult<Buffer>> handler)` Deprecated. use `render(RoutingContext, String, String, Handler)`
    `void` | `render(RoutingContext context, String templateDirectory, String templateFileName, Handler<AsyncResult<Buffer>> handler)` Render the template

- - ### Method Detail

    - #### render

          @Deprecated
          default void render(RoutingContext context,
                                          String templateFileName,
                                          Handler<AsyncResult<Buffer>> handler)

      Deprecated. use `render(RoutingContext, String, String, Handler)`
      Render the template
      Parameters:
        `context` - the routing context
        `templateFileName` - the template file name to use
        `handler` - the handler that will be called with a result containing the buffer or a failure.

    - #### render

          void render(RoutingContext context,
                      String templateDirectory,
                      String templateFileName,
                      Handler<AsyncResult<Buffer>> handler)

      Render the template

      NOTE if you call method directly (i.e. not using `TemplateHandler`) make sure that templateFileName is sanitized via `Utils.normalizePath(String)`

      Parameters:
        `context` - the routing context
        `templateDirectory` - the template directory to use
        `templateFileName` - the relative template file name to use
        `handler` - the handler that will be called with a result containing the buffer or a failure.

    - #### isCachingEnabled

          default boolean isCachingEnabled()

      Returns true if the template engine caches template files. If false, then template files are freshly loaded each time they are used.
      Returns:
        True if template files are cached; otherwise, false.

Copyright © 2018 Eclipse. All rights reserved.