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 |
#INCLUDE(#FileName) |
Example |
#INCLUDE("myIncludeTemplate.tmpl") |
Input |
|
ProcessFileTemplate
Localizes a template and replaces embedded placeholders (TLE variables). Returns the complete page content.
Syntax |
$Content = ProcessFileTemplate($FileName, $LanguageIdentifier, $hVars); $Content = ProcessFileTemplate($FileName, $LanguageIdentifier, $hVars, $TLEProcessor, $IncludeHandler); |
Example |
print ProcessFileTemplate('ProductDetails.html', 'en', \%Vars); |
Input |
|
Return |
|
SavedInclude
Caches the content of the block in a static file. The cached content can be reused in other templates if the file name is equal. The cached files are stored in the directory $ENV{EPAGES_STATIC}/SavedIncludes.
Syntax |
#BLOCK("SavedInclude", #FileName) ... #ENDBLOCK |
Example |
#BLOCK("SavedInclude", "MainMenu") ... #ENDBLOCK |
Input |
|
TRANSLATE
Translates a keyword during runtime of template, same result like {Key} in template.
Syntax |
$result = $Template->TRANSLATE($Processor, $raParams); #TRANSLATE(#Key, #DoProcess) |
Example |
#LOCAL("MaxLength", 6)#FUNCTION("TRANSLATE", "ValueTooLongName")#ENDLOCAL #LOCAL("MaxLength", 6)#FUNCTION("TRANSLATE", "ValueTooLongName", 0)#ENDLOCAL |
Input |
|
Return |
|