Skip to end of banner
Go to start of banner

executeTemplate

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Availability

This routine is available starting with katl-commons 4.0.

Syntax

executeTemplate(template_path[, charset] )

Description

Executes a template. All variables already defined in the script are passed to that template.

This routine obeys the context it is called. If you call it in an issue context, you can access issue fields in the template, if not you cannot.

Returns the string that represents the completed template.

Parameters

Parameter name

Type

Required

Description

template_path

string

Yes

The template path, either absolute or relative. Note that if relative, this path is based on KEPLER_HOME directory, and not to the mail templates directory.

charset

string

No

Specifies the charset used to read that template.

Return type

string

Example

Following template is represented below:

<KEPLER_HOME>/templates/some.tpl
$! if(isNotNull(baseVar)) { $
Well done, $baseVar$ !
$! } else { $
Nobody to congratulate ?!? Whoaaaa !!!
$! } $

Following script is represented below:

string baseVar = "Monster";
return executeTemplate("templates/some.tpl"); //note that we refer this relative to Kepler Home directory !

The output produced is following:

 Well done, Monster ! 

See also

 

  • No labels