Package DE_EPAGES::Dictionary::API::Template
This module provides file based template processing, including language dependend keywords. The package it self is also an INCLUDE Handler.
Example |
use DE_EPAGES::Dictionary::API::Template qw (ProcessFileTemplate); my $myContent = ProcessFileTemplate('myTemplate.tmpl', 'en', \%TemplateVars); |
@EXPORT_OK |
Functions
INCLUDE
TLE-Include on file base, replaces also the localizer tags. If the debugging mode for this function is enabled, an html comment wraps result (includes file name and processing time).
Syntax |
$result = $Handler->INCLUDE($Processor, $raParams); #INCLUDE("FileName") |
Example |
#INCLUDE("myIncludeTemplate.tmpl") |
Input |
|
Return |
|
ProcessFileTemplate
Localizes a template and replaces embedded placeholders (TLE variables). Returns the complete page content.
Syntax |
$Content = ProcessFileTemplate($FileName, $LanguageCode, $hVars); $Content = ProcessFileTemplate($FileName, $LanguageCode, $hVars, $TLEProcessor, $IncludeHandler); |
Example |
print ProcessFileTemplate('ProductDetails.html', 'en', \%Vars); |
Input |
|
Return |
|
TRANSLATE
Translates a keyword during runtime of template, same result like {Key} in template.
Syntax |
$result = $Handler->TRANSLATE($Processor, $raParams); #TRANSLATE(#Key, #DoProcess) |
Example |
#LOCAL("MaxLength", 6)#FUNCTION("TRANSLATE", "ValueTooLongName")#ENDLOCAL #LOCAL("MaxLength", 6)#FUNCTION("TRANSLATE", "ValueTooLongName", 0)#ENDLOCAL |
Input |
|
Return |
|