Constructor. May be called with two optional parameters. The first parameter sets the template directory (see set_root(), the second parameter sets the policy regarding handling of unknown variables.
The function checks that $root is a valid directory and sets this directory as the base directory where templates are being stored.
The function sets the policy for dealing with unresolved variable names. Must be either "remove", "comment" or "keep". If set to "keep", those are left untouched. If set to "comment", unresolved variable names are transformed into HTML comments reporting the error. If set to "remove", unresolved variable names are silently removed (the default).
The function defines a filename for the initial value of a variable. It may be called with either a $varname/$filename pair or with a hash of $varname/$filename pairs. The files are not loaded until they are needed.
A variable $parent may contain a variable block named by $varname. The function removes that block from $parent and replaces it with a variable reference named $name. If $name is omitted, it is assumed to be the same as $varname.
The functions sets the inital value of a variable. It may be called with either a $varname/$value pair or with a hash of $varname/$value pairs.
The function returns the value of the variable named $varname, with all defined variable values filled in. The resulting string is not "finished", that is, the unresolved variable name policy has not been applied yet.
The function substitutes the values of all defined variables in the variable named $varname and stores or appends the result in the variable named $target.
If $varname is an array of variable names, $append is ignored. The variables named by $varname are being sequentially substituted and the result of each substitution step is stored in $target. The resulting substitution is available in the variable named by $target, as is each intermediate step for the next $varname in sequence.
Returns the value of the variable named by $varname. If $varname references a file and that file has not been loaded, yet, the variable will be reported as empty. When called with an array of variable names, an hash of values, keyed by their names, will be returned.
The function will return a hash of unresolved variable names in $varname, keyed by their names (that is, the hash has the form $a[$name] = $name).
The function will returned the finished version of $str, that is, the policy regarding unresolved variable names will be applied to $str.
When called with a relative pathname, this function will return the pathname with the appropriate directory from $this->root prepended. Absolute pathnames are taken unchanged.
The resulting filename must exist or an error is generated.