renderFile


Description:

public static string? renderFile (Path templatePath, HashMap<string,string> vars)

Reads a template from a file and renders it with the given variables.

Example:

    var vars = new HashMap<string, string> (str_hash, str_equal);
vars.put ("title", "Home");
string ? result = Template.renderFile (
new Vala.Io.Path ("/tmp/page.tmpl"), vars);

Parameters:

templatePath

path to the template file.

vars

variable map.

Returns:

rendered string, or null if the file cannot be read.