Package DE_EPAGES::TLE::API::TLE
This package provides a basic content based template processing.
Example |
use DE_EPAGES::TLE::API::TLE qw( GetByteCodeByText ReplaceTLEVars ); my $Template = <<END_TEMPLATE; Scalar: #Scalar HashKey: #Hash.Key Loop: #LOOP(#List) #Value #ENDLOOP END_TEMPLATE my %TLE = ( 'Scalar' => 'Hello', 'Hash' => { 'Key' => 'Value' }, 'List' => [ { 'Value' => 'V1' }, { 'Value' => 'V2' } ], ); my $aByteCode = GetByteCodeByText( \$Template ); print ReplaceTLEVars( $aByteCode, \%TLE ); |
@EXPORT_OK |
Functions
GetByteCodeByText
Compiles template text to Perl code. Throws an error if the template syntax is not correct.
Syntax |
$PerlCode = GetByteCodeByText( $rPlainText ); |
Example |
$PerlCode = GetByteCodeByText( \"#IF(#ExampleTLE)example TLE has value#ENDIF" ); |
Input |
|
Output |
|
ReplaceTLEVars
This procedure uses a compiled TLE language to replace all occurencies according to the TLE syntax. For processing the base tle processor is used DE_EPAGES::TLE::API::BaseProcessor
Syntax |
$replacedContent = ReplaceTLEVars($aByteCode, $hVars, $hContext); |
Input |
|
Return |
|